PxMcRelease()
Release a memory class object.
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxMc_t PxMcRelease (PxMc_t Mc);
- ARGUMENTS
|
- RETURN VALUES
-
-
Invalid memory class handle on success
-
Mc on failure
-
- ERROR CODES
-
PXERR_MC_ILLMC
Mc
is not a valid memory class objectPXERR_MC_NOTEMPTY
Memory class delete failed: not empty
PXERR_OPOOL_ILLOPOOL
The object pool is not valid
PXERR_GLOBAL_ILLEGAL_CORE
The requested memory class is not on the same core
PXERR_TASK_ILLTASK
The task is not a valid task object
PXERR_INTERNAL_INCONSISTENCY
Inconsistency of internal structures
- DESCRIPTION
-
PxMcRelease releases the memory class handle Mc by converting it into a generic object and releasing this object.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
Mc
must be a valid PXROS-HR memory class created with aPxMcRequest
call (V). The validity ofMc
may also be checked by thePxMcIsValid
macro (F). The memory class must be created on the same core as the caller runs on. The creator core id can be read with the macroPxMcCoreId
and the own core id withPxGetCoreId
(C).
-
- After call
-
-
PxMcRelease
returns the memory class object to the object pool it has been taken from. On successPxMcRelease
returns the invalidated delay object. This may be checked with one of the following macros:-
PxMcIdIsValid()
must be false. -
PxMcIdGet()
must be_PXIllegalObjId
. -
PxMcIdError()
must bePXERR_NOERROR
otherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
After
PxMcRelease
, the given memory class objectMc
is no longer valid and may never be used as memory class object!
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMc_t Mc = PxMcRelease(Mc); if (PxMsgIdIsValid (Mc)) { // Report error }