Go to the source code of this file.
typedef void*( dtAllocFunc)(int size, dtAllocHint hint) |
typedef void( dtFreeFunc)(void *ptr) |
A memory deallocation function.
- Parameters
-
[in] | ptr | A pointer to a memory block previously allocated using dtAllocFunc. |
- See also
- dtAllocSetCustom
Provides hint values to the memory allocator on how long the memory is expected to be used.
Enumerator |
---|
DT_ALLOC_PERM |
Memory persist after a function call.
|
DT_ALLOC_TEMP |
Memory used temporarily within a function.
|
Memory persist after a function call.
Definition: DetourAlloc.h:26
Memory used temporarily within a function.
Definition: DetourAlloc.h:27
Allocates a memory block.
- Parameters
-
[in] | size | The size, in bytes of memory, to allocate. |
[in] | hint | A hint to the allocator on how long the memory is expected to be in use. |
- Returns
- A pointer to the beginning of the allocated memory block, or null if the allocation failed.
- See also
- dtFree
static dtAllocFunc * sAllocFunc
Definition: DetourAlloc.cpp:32
Sets the base custom allocation functions to be used by Detour.
- Parameters
-
[in] | allocFunc | The memory allocation function to be used by dtAlloc |
[in] | freeFunc | The memory de-allocation function to be used by dtFree |
static void * dtAllocDefault(int size, dtAllocHint)
Definition: DetourAlloc.cpp:22
static void dtFreeDefault(void *ptr)
Definition: DetourAlloc.cpp:27
static dtAllocFunc * sAllocFunc
Definition: DetourAlloc.cpp:32
static dtFreeFunc * sFreeFunc
Definition: DetourAlloc.cpp:33
void dtFree |
( |
void * |
ptr | ) |
|
Deallocates a memory block.
- Parameters
-
[in] | ptr | A pointer to a memory block previously allocated using dtAlloc. |
- See also
- dtAlloc
static dtFreeFunc * sFreeFunc
Definition: DetourAlloc.cpp:33