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 |
| #define | OSRTMH_PROPID_DEFBLKSIZE 1 |
| #define | OSRTMH_PROPID_SETFLAGS 2 |
| #define | OSRTMH_PROPID_CLEARFLAGS 3 |
| #define | OSRTMH_PROPID_USER 10 |
| #define | OSRTXM_K_MEMBLKSIZ (4*1024) |
| #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 | OSRTREALLOCARRAY(pctxt, pseqof, type) |
| #define | OSCRTMALLOC0(nbytes) malloc(nbytes) |
| #define | OSCRTFREE0(ptr) free(ptr) |
| #define | OSCRTMALLOC rtxMemAlloc |
| #define | OSCRTFREE rtxMemFreePtr |
| #define | OSCDECL |
| #define | rtxMemAlloc(pctxt, nbytes) rtxMemHeapAlloc(&(pctxt)->pMemHeap,nbytes) |
| #define | rtxMemAllocZ(pctxt, nbytes) rtxMemHeapAllocZ(&(pctxt)->pMemHeap,nbytes) |
| #define | rtxMemRealloc(pctxt, mem_p, nbytes) rtxMemHeapRealloc(&(pctxt)->pMemHeap, (void*)mem_p, nbytes) |
| #define | rtxMemFreePtr(pctxt, mem_p) |
| #define | rtxMemFree(pctxt) rtxMemHeapFreeAll(&(pctxt)->pMemHeap) |
| #define | rtxMemReset(pctxt) rtxMemHeapReset(&(pctxt)->pMemHeap) |
| #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 | rtxMemFreeType(pctxt, mem_p) rtxMemHeapFreePtr(&(pctxt)->pMemHeap, (void*)mem_p) |
| #define | rtxMemAllocArray(pctxt, n, type) (type*)rtxMemHeapAlloc (&(pctxt)->pMemHeap, sizeof(type)*n) |
| Allocate a dynamic array. | |
| #define | rtxMemAllocArrayZ(pctxt, n, type) (type*)rtxMemHeapAllocZ (&(pctxt)->pMemHeap, sizeof(type)*n) |
| #define | rtxMemFreeArray(pctxt, mem_p) rtxMemHeapFreePtr(&(pctxt)->pMemHeap, (void*)mem_p) |
| #define | rtxMemReallocArray(pctxt, mem_p, n, type) (type*)rtxMemHeapRealloc(&(pctxt)->pMemHeap, (void*)mem_p, sizeof(type)*n) |
Typedefs | |
| typedef void *OSCDECL * | OSMallocFunc (size_t size) |
| typedef void *OSCDECL * | OSReallocFunc (void *ptr, size_t size) |
Functions | |
| void | rtxMemSetAllocFuncs (OSMallocFunc malloc_func, OSReallocFunc realloc_func, OSFreeFunc free_func) |
| This function sets the pointers to standard allocation functions. | |
| void | rtxMemSetDefBlkSize (OSUINT32 blkSize) |
| This function sets the minimum size and the granularity of memory blocks for newly created memory heaps. | |
| OSUINT32 | rtxMemGetDefBlkSize () |
| This function returns the actual granularity of memory blocks. | |
| 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.
