tk_ref_mpf
Reference Fixed-size Memory Pool Status
See Also
ER ercd = tk_ref_mpf ( ID mpfid, T_RMPF *pk_rmpf ) ;
ID mpfid Fixed-size memory pool ID
T_RMPF* pk_rmpf Address of packet for returning status information
ER ercd Error code
pk_rmpf detail:
VP exinf Extended information
ID wtsk Waiting task information
W frbcnt Free block count
(Other implementation-dependent parameters may be added beyond this point.)
E_OK Normal completion
E_ID Invalid ID number (mpfid is invalid or cannot be used)
E_NOEXS Object does not exist (the fixed-size memory pool specified in mpfid does not exist)
E_PAR Parameter error (the return parameter packet address cannot be used)
References the status of the fixed-size memory pool specified in mpfid, passing in return parameters the current free block count frbcnt, waiting task information (wtsk), and extended information (exinf).
wtsk indicates the ID of a task waiting for memory block allocation from this fixed-size memory pool.
If multiple tasks are waiting for the fixed-size memory pool, the ID of the task at the head of the queue is returned. If there are no waiting tasks, wtsk = 0 is returned.
If the fixed-size memory pool specified with tk_ref_mpf does not exist, error code E_NOEXS is returned.
At least one of frbcnt = 0 and wtsk = 0 is always true for this system call.
Whereas frsz returned by tk_ref_mpl gives the total free memory size in bytes, frbcnt returns the number of unused memory blocks.
frbcnt, the member of T_RMBF, is of W type instead of INT type.

Comments
Click here to Post a Comment