PathEngine home previous: PathEngine_InitialiseCP3DAndObtainInterfacenext: PathEngine_ShutDown
Contents, API Reference, Functions, PathEngine_SetDefaultAllocator



Enables a custom allocation strategy to be supplied for PathEngine internal allocations (default allocator).


This function is defined in 'SDKRoot/interface/PathEngine_DirectLinkage.h', (included in the source code archives), as follows:
extern "C"
void PathEngine_SetDefaultAllocator(iAllocator* allocator);


allocator A pointer to an object inheriting from the iAllocator interface, which PathEngine will call for memory allocations.


This function is for use when statically linking against the SDK.
(Use DLLExport_SetDefaultAllocator() for dynamic linkage situations.)

This function can only be called

SDK initialisation with PathEngine_InitialiseAndObtainRootInterface().

The pointed to allocator object must then remain valid either until PathEngine is explicitly shut down, or until global or static object destruction time.
It is ok for the allocator object to be declared as a global (or static) scoped object, since PathEngine does not allocate memory from any global (or static) objects internally.

Explicit shutdown with PathEngine_ShutDown() is necessary if you want to ensure that each allocation is matched with a call to free(), i.e. with leak checking allocators.

Documentation for PathEngine release 6.00 - Copyright © 2002-2016 PathEnginenext: PathEngine_ShutDown