struct IMemoryManager { enum { BAD_HEAP_HANDLE = 0xFF }; struct SProcessMemInfo { uint64 PageFaultCount; uint64 PeakWorkingSetSize; uint64 WorkingSetSize; uint64 QuotaPeakPagedPoolUsage; uint64 QuotaPagedPoolUsage; uint64 QuotaPeakNonPagedPoolUsage; uint64 QuotaNonPagedPoolUsage; uint64 PagefileUsage; uint64 PeakPagefileUsage; uint64 TotalPhysicalMemory; int64 FreePhysicalMemory; uint64 TotalVideoMemory; int64 FreeVideoMemory; }; enum EAllocPolicy { eapDefaultAllocator, eapGPU, eapPageMapped, eapGPUEternal, eapCustomAlignment }; };
CryMemoryManager.h
Interfaces that allow access to the CryEngine memory manager.
enum EAllocPolicy { eapDefaultAllocator, eapGPU, eapPageMapped, eapGPUEternal, eapCustomAlignment };
CryMemoryManager.h
struct SProcessMemInfo { uint64 PageFaultCount; uint64 PeakWorkingSetSize; uint64 WorkingSetSize; uint64 QuotaPeakPagedPoolUsage; uint64 QuotaPagedPoolUsage; uint64 QuotaPeakNonPagedPoolUsage; uint64 QuotaNonPagedPoolUsage; uint64 PagefileUsage; uint64 PeakPagefileUsage; uint64 TotalPhysicalMemory; int64 FreePhysicalMemory; uint64 TotalVideoMemory; int64 FreeVideoMemory; };
CryMemoryManager.h
virtual ~IMemoryManager();
MEMMAN_METHOD(HeapHandle TraceDefineHeap( const char *heapName,size_t size,const void* pBase ));
Heap Tracing API
MEMMAN_METHOD(ICustomMemoryHeap* const CreateCustomMemoryHeapInstance(EAllocPolicy const eAllocPolicy));
Create an instance of ICustomMemoryHeap
MEMMAN_METHOD(IDefragAllocator* CreateDefragAllocator());
MEMMAN_METHOD(IGeneralMemoryHeap* CreateGeneralExpandingMemoryHeap(size_t upperLimit, size_t reserveSize, const char* sUsage));
MEMMAN_METHOD(IGeneralMemoryHeap* CreateGeneralMemoryHeap(void* base, size_t sz,const char *sUsage));
MEMMAN_METHOD(IMemoryAddressRange* ReserveAddressRange(size_t capacity, const char* sName));
MEMMAN_METHOD(IPageMappingHeap* CreatePageMappingHeap(size_t addressSpace, const char* sName));
MEMMAN_METHOD(bool GetLevelHeapViolationState(bool& usingLevelHeap, size_t& numAllocs, size_t& allocSize));
Fetch the violation status of the level heap
MEMMAN_METHOD(bool GetProcessMemInfo( SProcessMemInfo &minfo ));
MEMMAN_METHOD(int LocalSwitchToGlobalHeap());
Enable the global heap for this thread only. Returns previous heap selection, which must be passed to LocalSwitchToHeap.
MEMMAN_METHOD(int LocalSwitchToLevelHeap());
Enable the level heap for this thread only. Returns previous heap selection, which must be passed to LocalSwitchToHeap.
MEMMAN_METHOD(struct IMemReplay* GetIMemReplay());
Retrieve access to the MemReplay implementation class.
MEMMAN_METHOD(uint32 TraceHeapGetColor());
MEMMAN_METHOD(void FakeAllocation( long size ));
Used to add memory block size allocated directly from the crt or OS to the memory manager statistics.
MEMMAN_METHOD(void FreePages(void* p, size_t size));
MEMMAN_METHOD(void InitialiseLevelHeap());
Initialise the level heap.
MEMMAN_METHOD(void LocalSwitchToHeap(int heap));
Switch to a specific heap for this thread only. Usually used to undo a previous LocalSwitchToGlobalHeap
MEMMAN_METHOD(void SwitchToGlobalHeap());
Switch the default heap to the global heap.
MEMMAN_METHOD(void SwitchToLevelHeap());
Switch the default heap to the level heap.
MEMMAN_METHOD(void TraceHeapAlloc( HeapHandle heap,void* mem, size_t size, size_t blockSize, const char *sUsage,const char *sNameHint=0 ));
MEMMAN_METHOD(void TraceHeapFree( HeapHandle heap,void* mem, size_t blockSize ));
MEMMAN_METHOD(void TraceHeapSetColor( uint32 color ));
MEMMAN_METHOD(void TraceHeapSetLabel( const char *sLabel ));
MEMMAN_METHOD(void* AllocPages(size_t size));
typedef unsigned char HeapHandle;