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

PathEngine_SetDefaultAllocator

Description

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

Syntax

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);
}

Parameters

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

Remarks

This function is for use when statically linking against the SDK.
(Pass an allocator pointer into DLLExport_Init to set a custom allocator when linking with PathEngine as a DLL.)

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.04 - Copyright © 2002-2024 PathEnginenext: PathEngine_ShutDown