PxMcReturnBlk()
Return a block to the memory class.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxError_t PxMcReturnBlk (PxMc_t mcid, PxMptr_t blk); - ARGUMENTS
|
|
|
- RETURN VALUES
-
-
PXROS error code
-
- ERROR CODES
-
PXERR_GLOBAL_ILLEGAL_COREThe requested memory class is not on the same core
PXERR_MC_DAMAGED_BLOCKThe block is damaged
PXERR_MC_ILLMCmcidis not a valid memory classPXERR_MC_NOT_ALLOCATEDThe block is not allocated
PXERR_MC_NOT_ALLOCATED_FROMBlock not taken from the memory class
PXERR_MC_INCONSISTENCYInconsistency in memory class:
blkPXERR_MC_ILLALIGNInvalid memory block or size alignment in memory insert
PXERR_MC_ILLSIZEInsufficient block size
PXERR_MC_NOMEMNot enough memory in the memory class to satisfy the request
PXERR_INIT_ILLMCTYPEThe type for
PXMcSystemdefaultis different fromPXMcVarsized,PXMcVarsizedAdjustedandPXMcVarsizedAlignedPXERR_UNSUPPORTED_MCTYPEmc is not supported (If
mcidcorresponds toPXMcVarsized,PXMcVarsizedAligned,PXMcVarsizedAdjusted) - DESCRIPTION
-
PxMcReturnBlkreturns blockblktomcid.blkis set to zero.blkmust have been gotten by aPxMcTakeBlkcall from the same memory class as it is returned to.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
mcidmust be:-
a valid PXROS-HR memory class created with a
PxMcRequestcall (V). The validity ofmcidmay also be checked by thePxMcIsValidmacro (F). -
the symbolic value
PXMcSystemdefaultspecifying the system memory class (V) -
the symbolic value
PXMcTaskdefaultspecifying the task’s memory class (V)
-
-
The memory class must be created on the same core as the caller runs on. The creator core id can be read with the macro
PxMcCoreIdand the own core id withPxGetCoreId(C). -
blkmust be the start of a memory block taken byPxMcTakeBlkfrom the memory classmcid.
-
- After call
-
-
The function returns
PXERR_NOERRORif the memory block has been returned to the memory class. Any other return value describes an error, which has to be interpreted. (C)
-
- Best Practice
-
-
After
PxMcReturnBlk, the given memory blockblkis no longer valid and may never be used as a memory block!
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxError_t Err = PxMcReturnBlk(mcid, blk) if (Err != PXERR_NOERROR) { // Report error }