#include <cafe/os/OSDynLoad.h> typedef int (*OSDynLoad_pfMemAlloc)(int aMemBytes, int aMemAlign, void **appRetPtr); typedef void (*OSDynLoad_pfMemFree)(void *pAddr); int OSDynLoad_GetAllocator(OSDynLoad_pfMemAlloc * apRetAlloc, OSDynLoad_pfMemFree * apRetFree);
|apRetAlloc||Pointer to the function pointer variable to receive the address of the currently set allocator.|
|apRetFree||Pointer to the function pointer variable to receive the address of the currently set deallocator.|
OSDYNLOAD_ERR_xxx error code (see
Allows you to atomically get the allocator used by the loader to allocate read/write areas for the RPL files that are loaded.
The allocator function (
OSDynLoad_pfMemAlloc) takes as arguments the number of
bytes to allocate, the alignment, and a return pointer for the allocated block.
A nonzero return code indicates an error. The alignment value may be
negative. In this case, memory should be allocated
at the highest address possible in whatever heap is used.
Calls to this function are atomic with respect to loaded files.
Memory allocated by the allocator is only ever freed using the corresponding deallocator. This is true even if the allocator/deallocator is changed after an initial allocation.
2013/05/08 Automated cleanup pass.
2011/03/11 Initial version.