#include <stddef.h>
Go to the source code of this file.
◆ dtAllocFunc
typedef void*() dtAllocFunc(size_t size, dtAllocHint hint) |
◆ dtFreeFunc
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
◆ dtAllocHint
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.
|
◆ dtAlloc()
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
◆ dtAllocSetCustom()
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 |
◆ dtFree()
void dtFree |
( |
void * |
ptr | ) |
|
Deallocates a memory block.
- Parameters
-
[in] | ptr | A pointer to a memory block previously allocated using dtAlloc. |
- See also
- dtAlloc