Go to the source code of this file.
typedef void*( rcAllocFunc)(int size, rcAllocHint hint) |
typedef void( rcFreeFunc)(void *ptr) |
A memory deallocation function.
- Parameters
-
[in] | ptr | A pointer to a memory block previously allocated using rcAllocFunc. |
- See also
- rcAllocSetCustom
Provides hint values to the memory allocator on how long the memory is expected to be used.
Enumerator |
---|
RC_ALLOC_PERM |
Memory will persist after a function call.
|
RC_ALLOC_TEMP |
Memory used temporarily within a function.
|
Memory will persist after a function call.
Definition: RecastAlloc.h:26
Memory used temporarily within a function.
Definition: RecastAlloc.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
- rcFree
-
rcAllocSetCustom
static rcAllocFunc * sRecastAllocFunc
Definition: RecastAlloc.cpp:33
Sets the base custom allocation functions to be used by Recast.
- Parameters
-
[in] | allocFunc | The memory allocation function to be used by rcAlloc |
[in] | freeFunc | The memory de-allocation function to be used by rcFree |
- See also
- rcAlloc, rcFree
static rcFreeFunc * sRecastFreeFunc
Definition: RecastAlloc.cpp:34
static void rcFreeDefault(void *ptr)
Definition: RecastAlloc.cpp:28
static void * rcAllocDefault(int size, rcAllocHint)
Definition: RecastAlloc.cpp:23
static rcAllocFunc * sRecastAllocFunc
Definition: RecastAlloc.cpp:33
void rcFree |
( |
void * |
ptr | ) |
|
Deallocates a memory block.
- Parameters
-
[in] | ptr | A pointer to a memory block previously allocated using rcAlloc. |
- See also
- rcAlloc
- Warning
- This function leaves the value of
ptr
unchanged. So it still points to the same (now invalid) location, and not to null.
- See also
- rcAllocSetCustom
static rcFreeFunc * sRecastFreeFunc
Definition: RecastAlloc.cpp:34