30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.6. MEMORY POOL MANAGEMENT FUNCTIONS 161<br />

tk rel mpl<br />

Release Variable-size Memory Block<br />

[C Language Interface]<br />

ER ercd = tk_rel_mpl ( ID mplid, VP blk ) ;<br />

[Parameters]<br />

ID mplid Variable-size memory pool ID<br />

VP blf Memory block start address<br />

[Return Parameters]<br />

ER ercd Error code<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E PAR<br />

Normal completion<br />

Invalid ID number (mplid is invalid or cannot be used)<br />

Object does not exist (the variable-size memory pool designated in mplid does not exist)<br />

Parameter error (blk is invalid, or block returned to wrong memory pool)<br />

[Description]<br />

Returns the memory block designated in blk to the variable-size memory pool designated in mplid.<br />

Executing tk rel mpl may enable memory block acquisition by another task waiting to allocate memory<br />

from the memory pool designated in mplid, releasing the WAIT state of that task.<br />

When a memory block is returned to a variable-size memory pool, it must be the same variable-size<br />

memory pool from which the block was allocated. If an attempt to return a memory block to a different<br />

memory pool is detected, error code E PAR is returned. Whether this error detection is made or not is<br />

implementation-dependent.<br />

[Additional Notes]<br />

When memory is returned to a variable-size memory pool in which multiple tasks are queued, multiple<br />

tasks may be released at the same time depending on the amount of memory returned and their requested<br />

memory size. The task precedence among tasks of the same priority after their WAIT state is released<br />

in such a case is the order in which they were queued.<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!