Recast Navigation
Navigation-mesh Toolset for Games
DetourAlloc.h File Reference
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef void *() dtAllocFunc(size_t size, dtAllocHint hint)
 A memory allocation function. More...
 
typedef void() dtFreeFunc(void *ptr)
 A memory deallocation function. More...
 

Enumerations

enum  dtAllocHint { DT_ALLOC_PERM , DT_ALLOC_TEMP }
 Provides hint values to the memory allocator on how long the memory is expected to be used. More...
 

Functions

void dtAllocSetCustom (dtAllocFunc *allocFunc, dtFreeFunc *freeFunc)
 Sets the base custom allocation functions to be used by Detour. More...
 
void * dtAlloc (size_t size, dtAllocHint hint)
 Allocates a memory block. More...
 
void dtFree (void *ptr)
 Deallocates a memory block. More...
 

Typedef Documentation

◆ dtAllocFunc

typedef void*() dtAllocFunc(size_t size, dtAllocHint hint)

A memory allocation function.

See also
dtAllocSetCustom

◆ dtFreeFunc

typedef void() dtFreeFunc(void *ptr)

A memory deallocation function.

Parameters
[in]ptrA pointer to a memory block previously allocated using dtAllocFunc.
See also
dtAllocSetCustom

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ dtAlloc()

void* dtAlloc ( size_t  size,
dtAllocHint  hint 
)

Allocates a memory block.

Parameters
[in]sizeThe size, in bytes of memory, to allocate.
[in]hintA 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()

void dtAllocSetCustom ( dtAllocFunc allocFunc,
dtFreeFunc freeFunc 
)

Sets the base custom allocation functions to be used by Detour.

Parameters
[in]allocFuncThe memory allocation function to be used by dtAlloc
[in]freeFuncThe memory de-allocation function to be used by dtFree

◆ dtFree()

void dtFree ( void *  ptr)

Deallocates a memory block.

Parameters
[in]ptrA pointer to a memory block previously allocated using dtAlloc.
See also
dtAlloc