- 50 -
4.1.9
Memory pool Management Function(Fixed-size Memory pool)
A fixed-size memory pool is the memory of a certain decided size. The memory block size is specified at the time of a con-
figuration. Figure 4.17 is a figure about the example of a fixed-size memory pool of operation.
•
Acquire Fixed-size Memory Block (get_mpf, tget_mpf)
Acquires a memory block from the fixed-size memory pool that has the specified ID. If there are no blank mem-
ory blocks in the specified fixed-size memory pool, the task that issued this service call goes to WAITING state
and is enqueued in a waiting queue.
•
Acquire Fixed-size Memory Block (polling) (pget_mpf, ipget_mpf)
Acquires a memory block from the fixed-size memory pool that has the specified ID. The difference from the
get_mpf and tget_mpf service calls is that if there are no blank memory blocks in the memory pool, the task re-
turns error code without going to WAITING state.
Fixed Length Memorypool
Memory Block 1:
Memory Block 2:
Memory Block 3:
Used by TaskA
Used by TaskB
Memory block acquisition
request
Memory block acquisition
TaskC
Memory block acquisition
request
No blank memory
blocks available
TaskD
Goes to a
wait state
Figure 4.17 Memory Pool Management
•
Release Fixed-size Memory Block (rel_mpf, irel_mpf)
Frees the acquired memory block. If there are any tasks in a wait state for the specified fixed-size memory pool,
the task enqueued at the top of the waiting queue is assigned the freed memory block. In this case, the task
changes its state from WAITING state to READY state. If there are no tasks in a wait state, the memory block is
returned to the memory pool.
•
Reference Fixed-size Memory Pool Status (ref_mpf, iref_mpf)
Checks the number and the size of blank blocks available in the target memory pool.