- 52 -
[[Comparison of Two Management Methods]]
•
Processing speed
Generally speaking, the normal block method is faster in memory allocation/deallocation processing than the
small block method.
•
Memory usage efficiency
If the difference between the maximum and minimum sizes of memory to be acquired is 8 times or more, the
small block method is higher in memory usage efficiency than the other method.
•
Ease of configuration
For the normal block method, it is necessary that the maximum memory size to be acquired be known to the
MR100. However, this is unnecessary for the small block method..
The variable-length memory pool management service calls provided by the MR100 include the following.
•
Get a memory block (pget_mpl)
The block size specified by the user is acquired by first rounding it to the optimum block size among the four
kinds of block sizes and then acquiring a memory block of the rounded size from the memory pool
For example, if the user requests 200 bytes of memory, the requested size is rounded to 224 bytes, so that 224
bytes of memory is acquired. If a requested block of memory is successfully acquired, the start address of the ac-
quired memory block and error code E_OK are returned. If memory acquisition fails, error code E_TMOUT is
returned.
.
200 bytes
224 bytes
Rounding
Memorypool
TaskA
pget_mpl
200 bytes
Figure 4.18 pget_mpl processing
•
Release Acquire Variable-size Memory Block (rel_mpl)
Releases a acquired memory block by pget_mpl service call.
25
The validity of the address of the memory block to which MR100 is passed as an argument and to release is not judged. Therefore, op-
eration at the time of releasing the memory block which is already released or releasing the memory block which has not been gained is not
guaranteed.