![]() |
DriveWorks SDK Reference| 0.6.67 Release |
Processes wide dynamic memory API.
Typedefs | |
typedef void(* | dwDynamicMemoryFreeCallback) (void *addr, void *userData) |
typedef void *(* | dwDynamicMemoryMallocCallback) (size_t sizeInByte, void *userData) |
Enumerations | |
enum | dwRuntimeMode { DW_MODE_INIT = 0x0000, DW_MODE_RUNTIME = 0x0001, DW_MODE_CLEANUP = 0x0002 } |
Context runtime mode. More... | |
Functions | |
DW_API_PUBLIC dwStatus | dwDynamicMemory_getCallbacks (dwDynamicMemoryMallocCallback *mallocCallback, dwDynamicMemoryFreeCallback *freeCallback, void **userData) |
Get callbacks and user-defined general pointer previously passed in dwDynamicMemory_initialize. More... | |
DW_API_PUBLIC dwStatus | dwDynamicMemory_initialize (dwDynamicMemoryMallocCallback mallocCallback, dwDynamicMemoryFreeCallback freeCallback, void *userData) |
Initialize dwDynamicMemory with user-defined callback for user space memory allocations. More... | |
DW_API_PUBLIC dwStatus | dwDynamicMemory_release () |
Release dwDynamicMemory. More... | |
DW_API_PUBLIC dwStatus | dwDynamicMemory_updateRuntimeMode (dwRuntimeMode newMode) |
Switch runtime mode for all Driveworks SDK. More... | |
DW_API_PUBLIC void * | memcpy_opt (void *__restrict destination, const void *__restrict source, size_t num) |
Memory copy of virtual process memory. More... | |
typedef void(* dwDynamicMemoryFreeCallback) (void *addr, void *userData) |
Definition at line 62 of file DynamicMemory.h.
typedef void*(* dwDynamicMemoryMallocCallback) (size_t sizeInByte, void *userData) |
Definition at line 61 of file DynamicMemory.h.
enum dwRuntimeMode |
Context runtime mode.
Definition at line 97 of file DynamicMemory.h.
DW_API_PUBLIC dwStatus dwDynamicMemory_getCallbacks | ( | dwDynamicMemoryMallocCallback * | mallocCallback, |
dwDynamicMemoryFreeCallback * | freeCallback, | ||
void ** | userData | ||
) |
Get callbacks and user-defined general pointer previously passed in dwDynamicMemory_initialize.
Optionally pass NULL if not interested in retrieving the pointers
[out] | mallocCallback | returned by pointer address of the mallocCallback. |
[out] | freeCallback | returned by pointer address of the freeCallback. |
[out] | userData | returned by pointer value of previously passed userData during initialization. |
DW_API_PUBLIC dwStatus dwDynamicMemory_initialize | ( | dwDynamicMemoryMallocCallback | mallocCallback, |
dwDynamicMemoryFreeCallback | freeCallback, | ||
void * | userData | ||
) |
Initialize dwDynamicMemory with user-defined callback for user space memory allocations.
If initialization is not performed or if user provides NULL pointers for the callbacks then CRT heap allocation routines will be used.
[in] | mallocCallback | functions which will be used for memory allocation. NULL for CRT implementation |
[in] | freeCallback | functions which will be used for memory deallocation. NULL for CRT implementation |
[in] | userData | general pointer to something understandable by mallocCallback or freeCallback |
DW_API_PUBLIC dwStatus dwDynamicMemory_release | ( | ) |
Release dwDynamicMemory.
After this call all following requests for memory allocation will use the CRT heap allocation mechanisms.
DW_API_PUBLIC dwStatus dwDynamicMemory_updateRuntimeMode | ( | dwRuntimeMode | newMode | ) |
Switch runtime mode for all Driveworks SDK.
A runtime mode is activated after full initialization phase. Switching to runtime mode allows context to perform checks if for example heap allocations are still hapenning. Runtime mode does not have any effect on the performance of the SDK modules, it can, however, used for debugging purpose.
[in] | newMode | mode that you want to setup |
DW_API_PUBLIC void* memcpy_opt | ( | void *__restrict | destination, |
const void *__restrict | source, | ||
size_t | num | ||
) |
Memory copy of virtual process memory.
This subroutine call standard memcpy for x86_64, and custom optimized implementation for aarch64. As in standart memcpy call destination and source memory blocks should not overlap.
[out] | destination | pointer to destination memory into which num bytes will be copied from source |
[in] | source | pointer to source memory which will be copied destination |
[in] | num | number of bytes to copy |