It is possible to replace the core memory management functions used by the XBinder run-time memory manager. This has the advantage of preserving the existing management scheme but with the use of different core functions. Using different core functions may be necessary on some systems that do not have the standard C run-time functions malloc, free, and realloc, or when extra functionality is desired.
To replace the core functions, the following run-time library function would be used:
void rtxMemSetAllocFuncs (OSMallocFunc malloc_func, OSReallocFunc realloc_func, OSFreeFunc free_func);
The malloc, realloc, and free functions must have the same prototype as the standard C functions. Some systems do not have a realloc-like function. In this case, realloc_func may be set to NULL. This will cause the malloc_func/free_func pair to be used to do reallocations.
This function must be called before the context initialization function (rtInitContext) because context initialization requires low level memory management facilities be in place in order to do its work.