PxMcRelease()
Release a memory class object.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxMc_t PxMcRelease (PxMc_t Mc); - ARGUMENTS
|
- RETURN VALUES
-
-
Invalid memory class handle on success
-
Mc on failure
-
- ERROR CODES
-
PXERR_MC_ILLMCMcis not a valid memory class objectPXERR_MC_NOTEMPTYMemory class delete failed: not empty
PXERR_OPOOL_ILLOPOOLThe object pool is not valid
PXERR_GLOBAL_ILLEGAL_COREThe requested memory class is not on the same core
PXERR_TASK_ILLTASKThe task is not a valid task object
PXERR_INTERNAL_INCONSISTENCYInconsistency of internal structures
- DESCRIPTION
-
PxMcReleasereleases the memory class handle Mc by converting it into a generic object and releasing this object.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
Mcmust be a valid PXROS-HR memory class created with aPxMcRequestcall (V). The validity ofMcmay also be checked by thePxMcIsValidmacro (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 macroPxMcCoreIdand the own core id withPxGetCoreId(C).
-
- After call
-
-
PxMcReleasereturns the memory class object to the object pool it has been taken from. On successPxMcReleasereturns 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_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
After
PxMcRelease, the given memory class objectMcis 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 }