PathEngine home previous: Preprocessor Definesnext: Static Linkage
Contents, Programmers Guide, Building the Source Code, Customising Memory Management

Customising Memory Management

See 'code/common/MemoryLog.h' and 'code/common/MemoryTracking.h' for examples of custom memory allocation and deallocation.

MemoryTracking.cpp provides the memory tracking that is compiled in to the standard release build.

MemoryLog.cpp records information about memory allocation and deallocation to a file that can subsequently be inspected for details about any memory leaks.

To customise memory allocation and deallocation, simply add an object that overrides the global new and delete in the same way as in these examples.
You need to ensure that only one of these objects is compiled in to any given build otherwise the compiler will complain about redefinition of these global operators.
(If you add a custom memory allocation object then simply remove 'MEMORY_TRACKING' from the list of defines in the project settings.

Customisation of memory allocation is currently only supported when linking the run-time library as a dll, on platforms that support dll linkage.


Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEnginenext: Static Linkage