46 #ifndef DW_CORE_DYNAMIC_MEMORY_H_ 47 #define DW_CORE_DYNAMIC_MEMORY_H_ 53 #define DWALLOC_API_PUBLIC __attribute__((visibility("default"))) 55 #define DWALLOC_API_PUBLIC 72 typedef void* (*dwDynamicMemoryMallocCallback)(
size_t sizeInByte,
void* userData);
90 void*
const userData);
112 void**
const userData);
178 #endif // DW_CORE_DYNAMIC_MEMORY_H_ DWALLOC_API_PUBLIC void dwDynamicMemory_initialize(dwDynamicMemoryMallocCallback mallocCallback, dwDynamicMemoryFreeCallback freeCallback, void *const userData)
Initialize dwDynamicMemory with user-defined callback for user space memory allocations.
dwRuntimeMode
Context runtime mode.
void(* dwDynamicMemoryFreeCallback)(void *addr, void *userData)
DWALLOC_API_PUBLIC void dwDynamicMemory_setErrorCallback(dwDynamicMemoryErrorCallback errorCallback, void *const userData)
Set error callback to be executed on an allocation error.
Heap memory allocations and deallocations are allowed.
DWALLOC_API_PUBLIC void dwDynamicMemory_getCallbacks(dwDynamicMemoryMallocCallback *const mallocCallback, dwDynamicMemoryFreeCallback *const freeCallback, void **const userData)
Get callbacks and user-defined general pointer previously passed in dwDynamicMemory_initialize.
Heap memory allocations and deallocations are allowed. Default.
Heap memory allocations are not allowed.
DWALLOC_API_PUBLIC void * dwDynamicMemory_malloc(size_t const size)
Allocate chunk of memory using allocator passed through dwDynamicMemory_initialize().
dwDynamicMemoryError
Error to be reported through error callback.
Allocation is currently not allowed, because in runtime mode.
void(* dwDynamicMemoryErrorCallback)(dwDynamicMemoryError error, size_t lastRequestedSizeInByte, void *userData)
Memory allocation failed, probably not enough memory.
DWALLOC_API_PUBLIC void dwDynamicMemory_release()
Release dwDynamicMemory.
DWALLOC_API_PUBLIC bool dwDynamicMemory_setRuntimeMode(dwRuntimeMode const newMode)
Switch runtime mode for all Driveworks SDK.
void *(* dwDynamicMemoryMallocCallback)(size_t sizeInByte, void *userData)
#define DWALLOC_API_PUBLIC
DWALLOC_API_PUBLIC bool dwDynamicMemory_getRuntimeMode(dwRuntimeMode *const mode)
Return currently selected runtime mode.
Memory release is currently not allowed, because in runtime mode.
DWALLOC_API_PUBLIC void dwDynamicMemory_free(void *const ptr)
Release memory chunk previously allocated with dwDynamicMemory_malloc().