IMemoryManager

C++
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
  };
};
File

CryMemoryManager.h

Description

Interfaces that allow access to the CryEngine memory manager.

IMemoryManager::EAllocPolicy Enumeration
C++
enum EAllocPolicy {
  eapDefaultAllocator,
  eapGPU,
  eapPageMapped,
  eapGPUEternal,
  eapCustomAlignment
};
File

CryMemoryManager.h

IMemoryManager::SProcessMemInfo Structure
C++
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;
};
File

CryMemoryManager.h

IMemoryManager::~IMemoryManager Destructor
C++
virtual ~IMemoryManager();
IMemoryManager::MEMMAN_METHOD Method (HeapHandle TraceDefineHeap( const char *heapName,size_t size,const void* pBase ))
C++
MEMMAN_METHOD(HeapHandle TraceDefineHeap( const char *heapName,size_t size,const void* pBase ));
Description

Heap Tracing API

IMemoryManager::MEMMAN_METHOD Method (ICustomMemoryHeap* const CreateCustomMemoryHeapInstance(EAllocPolicy const eAllocPolicy))
C++
MEMMAN_METHOD(ICustomMemoryHeap* const CreateCustomMemoryHeapInstance(EAllocPolicy const eAllocPolicy));
Description

Create an instance of ICustomMemoryHeap

IMemoryManager::MEMMAN_METHOD Method (IDefragAllocator* CreateDefragAllocator())
C++
MEMMAN_METHOD(IDefragAllocator* CreateDefragAllocator());
IMemoryManager::MEMMAN_METHOD Method (IGeneralMemoryHeap* CreateGeneralExpandingMemoryHeap(size_t upperLimit, size_t reserveSize, const char* sUsage))
C++
MEMMAN_METHOD(IGeneralMemoryHeap* CreateGeneralExpandingMemoryHeap(size_t upperLimit, size_t reserveSize, const char* sUsage));
IMemoryManager::MEMMAN_METHOD Method (IGeneralMemoryHeap* CreateGeneralMemoryHeap(void* base, size_t sz,const char *sUsage))
C++
MEMMAN_METHOD(IGeneralMemoryHeap* CreateGeneralMemoryHeap(void* base, size_t sz,const char *sUsage));
IMemoryManager::MEMMAN_METHOD Method (IMemoryAddressRange* ReserveAddressRange(size_t capacity, const char* sName))
C++
MEMMAN_METHOD(IMemoryAddressRange* ReserveAddressRange(size_t capacity, const char* sName));
IMemoryManager::MEMMAN_METHOD Method (IPageMappingHeap* CreatePageMappingHeap(size_t addressSpace, const char* sName))
C++
MEMMAN_METHOD(IPageMappingHeap* CreatePageMappingHeap(size_t addressSpace, const char* sName));
IMemoryManager::MEMMAN_METHOD Method (bool GetLevelHeapViolationState(bool& usingLevelHeap, size_t& numAllocs, size_t& allocSize))
C++
MEMMAN_METHOD(bool GetLevelHeapViolationState(bool& usingLevelHeap, size_t& numAllocs, size_t& allocSize));
Description

Fetch the violation status of the level heap

IMemoryManager::MEMMAN_METHOD Method (bool GetProcessMemInfo( SProcessMemInfo &minfo ))
C++
MEMMAN_METHOD(bool GetProcessMemInfo( SProcessMemInfo &minfo ));
IMemoryManager::MEMMAN_METHOD Method (int LocalSwitchToGlobalHeap())
C++
MEMMAN_METHOD(int LocalSwitchToGlobalHeap());
Description

Enable the global heap for this thread only. Returns previous heap selection, which must be passed to LocalSwitchToHeap.

IMemoryManager::MEMMAN_METHOD Method (int LocalSwitchToLevelHeap())
C++
MEMMAN_METHOD(int LocalSwitchToLevelHeap());
Description

Enable the level heap for this thread only. Returns previous heap selection, which must be passed to LocalSwitchToHeap.

IMemoryManager::MEMMAN_METHOD Method (struct IMemReplay* GetIMemReplay())
C++
MEMMAN_METHOD(struct IMemReplay* GetIMemReplay());
Description

Retrieve access to the MemReplay implementation class.

IMemoryManager::MEMMAN_METHOD Method (uint32 TraceHeapGetColor())
C++
MEMMAN_METHOD(uint32 TraceHeapGetColor());
IMemoryManager::MEMMAN_METHOD Method (void FakeAllocation( long size ))
C++
MEMMAN_METHOD(void FakeAllocation( long size ));
Description

Used to add memory block size allocated directly from the crt or OS to the memory manager statistics.

IMemoryManager::MEMMAN_METHOD Method (void FreePages(void* p, size_t size))
C++
MEMMAN_METHOD(void FreePages(void* p, size_t size));
IMemoryManager::MEMMAN_METHOD Method (void InitialiseLevelHeap())
C++
MEMMAN_METHOD(void InitialiseLevelHeap());
Description

Initialise the level heap.

IMemoryManager::MEMMAN_METHOD Method (void LocalSwitchToHeap(int heap))
C++
MEMMAN_METHOD(void LocalSwitchToHeap(int heap));
Description

Switch to a specific heap for this thread only. Usually used to undo a previous LocalSwitchToGlobalHeap

IMemoryManager::MEMMAN_METHOD Method (void SwitchToGlobalHeap())
C++
MEMMAN_METHOD(void SwitchToGlobalHeap());
Description

Switch the default heap to the global heap.

IMemoryManager::MEMMAN_METHOD Method (void SwitchToLevelHeap())
C++
MEMMAN_METHOD(void SwitchToLevelHeap());
Description

Switch the default heap to the level heap.

IMemoryManager::MEMMAN_METHOD Method (void TraceHeapAlloc( HeapHandle heap,void* mem, size_t size, size_t blockSize, const char *sUsage,const char *sNameHint=0 ))
C++
MEMMAN_METHOD(void TraceHeapAlloc( HeapHandle heap,void* mem, size_t size, size_t blockSize, const char *sUsage,const char *sNameHint=0 ));
IMemoryManager::MEMMAN_METHOD Method (void TraceHeapFree( HeapHandle heap,void* mem, size_t blockSize ))
C++
MEMMAN_METHOD(void TraceHeapFree( HeapHandle heap,void* mem, size_t blockSize ));
IMemoryManager::MEMMAN_METHOD Method (void TraceHeapSetColor( uint32 color ))
C++
MEMMAN_METHOD(void TraceHeapSetColor( uint32 color ));
IMemoryManager::MEMMAN_METHOD Method (void TraceHeapSetLabel( const char *sLabel ))
C++
MEMMAN_METHOD(void TraceHeapSetLabel( const char *sLabel ));
IMemoryManager::MEMMAN_METHOD Method (void* AllocPages(size_t size))
C++
MEMMAN_METHOD(void* AllocPages(size_t size));
IMemoryManager::HeapHandle Nested Type
C++
typedef unsigned char HeapHandle;