gwnavruntime/kernel/SF_SysAlloc.h Source File
Go to the documentation of this file.
25 virtual bool initHeapEngine(
const void* heapDesc) { KY_UNUSED(heapDesc);
return false; }
27 virtual void shutdownHeapEngine() { }
58 virtual void*
Alloc(UPInt size, UPInt align) = 0;
59 virtual void Free(
void* ptr, UPInt size, UPInt align) = 0;
60 virtual void*
Realloc(
void* oldPtr, UPInt oldSize, UPInt newSize, UPInt align) = 0;
64 virtual bool initHeapEngine(
const void* heapDesc);
65 virtual void shutdownHeapEngine();
79 template<
class A,
class B>
82 struct SysAllocContainer
84 UPInt Data[(
sizeof(A) +
sizeof(UPInt)-1) /
sizeof(UPInt)];
86 SysAllocContainer() : Initialized(0) { }
89 SysAllocContainer* pContainer;
94 static B* InitSystemSingleton()
96 static SysAllocContainer Container;
97 KY_ASSERT(Container.Initialized ==
false);
104 #if defined(KY_DEFINE_NEW)
105 #define new KY_DEFINE_NEW
108 presult->pContainer = &Container;
109 Container.Initialized =
true;
114 virtual void shutdownHeapEngine()
116 B::shutdownHeapEngine();
119 pContainer->Initialized =
false;
A base class for an object that manages memory allocations and de-allocations.
Definition: SF_SysAlloc.h:18
The SysAlloc class specifies an interface for allocating and freeing memory.
Definition: SF_SysAlloc.h:52
Adds to the SysAlloc class support for restricting instantiation to a single object.
Definition: SF_SysAlloc.h:80
virtual void * Realloc(void *oldPtr, UPInt oldSize, UPInt newSize, UPInt align)=0
Re-allocates a buffer to a new size.
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
virtual void * Alloc(UPInt size, UPInt align)=0
Allocates a buffer of the specified size, with the specified alignment.
virtual void Free(void *ptr, UPInt size, UPInt align)=0
Frees the specified memory buffer.