MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / _initialize

Method _initialize

ogsr_engine/xrCore/xrMemory.cpp:24–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22xrMemory Memory;
23
24void xrMemory::_initialize()
25{
26 SProcessMemInfo memCounters;
27 GetProcessMemInfo(memCounters);
28
29 u64 disableMemoryTotalMb = 32000ull;
30 if (char* str = strstr(Core.Params, "-smem_disable_limit "))
31 sscanf(str + 20, "%llu", &disableMemoryTotalMb);
32 bool disableMemoryPool = memCounters.TotalPhysicalMemory > (disableMemoryTotalMb * (1024ull * 1024ull));
33
34 if (disableMemoryPool)
35 {
36 Msg("--[%s] memory pool disabled due to available memory limit: [%u MB]", __FUNCTION__, disableMemoryTotalMb);
37 }
38
39 g_pStringContainer = xr_new<str_container>();
40 g_pSharedMemoryContainer = xr_new<smem_container>(disableMemoryPool);
41}
42
43void xrMemory::_destroy()
44{

Callers

nothing calls this directly

Calls 2

GetProcessMemInfoFunction · 0.85
MsgFunction · 0.85

Tested by

no test coverage detected