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

Functions

static void * dtAllocDefault (size_t size, dtAllocHint)
 
static void dtFreeDefault (void *ptr)
 
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...
 

Variables

static dtAllocFuncsAllocFunc = dtAllocDefault
 
static dtFreeFuncsFreeFunc = dtFreeDefault
 

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

◆ dtAllocDefault()

static void* dtAllocDefault ( size_t  size,
dtAllocHint   
)
static

◆ 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

◆ dtFreeDefault()

static void dtFreeDefault ( void *  ptr)
static

Variable Documentation

◆ sAllocFunc

dtAllocFunc* sAllocFunc = dtAllocDefault
static

◆ sFreeFunc

dtFreeFunc* sFreeFunc = dtFreeDefault
static