rtxMemory.h File Reference
Memory management function and macro definitions. More...
#include "rtxsrc/rtxContext.h"
Go to the source code of this file.
Defines | |
#define | RT_MH_DONTKEEPFREE 0x1 |
Uncomment this definition before building the C or C++ run-time libraries to enable compact memory management. | |
#define | OSRTALLOCTYPE(pctxt, type) (type*) rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type)) |
This macro allocates a single element of the given type. | |
#define | OSRTALLOCTYPEZ(pctxt, type) (type*) rtxMemHeapAllocZ (&(pctxt)->pMemHeap, sizeof(type)) |
This macro allocates and zeros a single element of the given type. | |
#define | rtxMemAllocType(pctxt, ctype) (ctype*)rtxMemHeapAlloc(&(pctxt)->pMemHeap,sizeof(ctype)) |
Allocate type. | |
#define | rtxMemAllocTypeZ(pctxt, ctype) (ctype*)rtxMemHeapAllocZ(&(pctxt)->pMemHeap,sizeof(ctype)) |
Allocate type and zero memory. | |
#define | rtxMemAllocArray(pctxt, n, type) (type*)rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type)*n) |
Allocate a dynamic array. | |
#define | rtxMemNewAutoPtr(pctxt, nbytes) rtxMemHeapAlloc(&(pctxt)->pMemHeap, nbytes) |
This function allocates a new block of memory and creates an auto-pointer with reference count set to one. | |
#define | rtxMemAutoPtrRef(pctxt, ptr) rtxMemHeapAutoPtrRef(&(pctxt)->pMemHeap, (void*)(ptr)) |
This function increments the auto-pointer reference count. | |
#define | rtxMemAutoPtrUnref(pctxt, ptr) rtxMemHeapAutoPtrUnref(&(pctxt)->pMemHeap, (void*)(ptr)) |
This function decrements the auto-pointer reference count. | |
#define | rtxMemAutoPtrGetRefCount(pctxt, ptr) rtxMemHeapAutoPtrGetRefCount(&(pctxt)->pMemHeap, (void*)(ptr)) |
This function returns the reference count of the given pointer. | |
Functions | |
EXTERNRT void | rtxMemSetAllocFuncs (OSMallocFunc malloc_func, OSReallocFunc realloc_func, OSFreeFunc free_func) |
This function sets the pointers to standard allocation functions. | |
EXTERNRT void | rtxMemSetDefBlkSize (OSUINT32 blkSize) |
This function sets the minimum size and the granularity of memory blocks for newly created memory heaps. | |
EXTERNRT OSUINT32 | rtxMemGetDefBlkSize () |
This function returns the actual granularity of memory blocks. | |
EXTERNRT OSBOOL | rtxMemIsZero (const void *pmem, size_t memsiz) |
This helper function determines if an arbitrarily sized block of memory is set to zero. |
Detailed Description
Memory management function and macro definitions.
Definition in file rtxMemory.h.
Define Documentation
#define RT_MH_DONTKEEPFREE 0x1 |
Uncomment this definition before building the C or C++ run-time libraries to enable compact memory management.
This will have a smaller code footprint than the standard memory management, however, the performance may not be as good.
Definition at line 41 of file rtxMemory.h.