PathEngine home previous: DLLExport_GetIPathEnginenext: PathEngine_InitialiseAndObtainRootInterface
Contents, API Reference, Functions, DLLExport_SetDefaultAllocator

DLLExport_SetDefaultAllocator

Description

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

Syntax

This function is defined internally by the PathEngine dll, as follows:
extern "C"
{
    void __stdcall DLLExport_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 dynamically linking against the SDK.
(Use PathEngine_SetDefaultAllocator() for static linkage situations.)

This function can only be called

obtaining the PathEngine SDK entrypoint with (for example) DLLExport_GetIPathEngine().

The function pointer can be obtained with GetProcAddress in the same way as described in Linking with the PathEngine DLL, but with exported function ordinal 3:

typedef void (__stdcall* tFunctionPtrType)(iAllocator*);
FARPROC procAddress;
procAddress = GetProcAddress(hInstance, (LPCSTR)3);
tFunctionPtrType functionPtr = (tFunctionPtrType)procAddress;
functionPtr(allocatorPtr);
	

The pointed to allocator object must then remain valid either until the DLL has been unloaded.


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