tk_rel_mpl

Release Variable-size Memory Block

[C Language Interface]

ER ercd = tk_rel_mpl ( ID mplid, VP blk ) ;

[Parameters]

ID mplid Variable-size memory pool ID

VP blf Memory block start address

[Return Parameters]

ER ercd Error code

[Error Codes]

E_OK Normal completion

E_ID Invalid ID number (mplid is invalid or cannot be used)

E_NOEXS Object does not exist (the variable-size memory pool specified in mplid does not exist)

E_PAR Parameter error (blk is invalid, or block returned to wrong memory pool)

[Description]

Returns the memory block specified in blk to the variable-size memory pool specified in mplid.

Executing tk_rel_mpl may enable memory block acquisition by another task waiting to allocate memory from the memory pool specified in mplid, releasing the WAIT state of that task.

When a memory block is returned to a variable-size memory pool, it must be the same variable-size memory pool from which the block was allocated. If an attempt to return a memory block to a di.erent memory pool is detected, error code epar is returned. Whether this error detection is made or not is implementation-dependent.

[Additional Notes]

When memory is returned to a variable-size memory pool in which multiple tasks are queued, multiple tasks may be released at the same time depending on the amount of memory returned and their requested memory size. The task precedence among tasks of the same priority after their WAIT state is released in such a case is the order in which they were queued.

Comments