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

Method mem_compact

ogsr_engine/xrCore/xrMemory.cpp:49–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void xrMemory::mem_compact()
50{
51#ifndef USE_MIMALLOC
52/*
53Следующая команда, в целом, не нужна.
54Современные аллокаторы достаточно грамотно и когда нужно возвращают память операционной системе.
55Эта строчка нужна, скорее всего, в определённых ситуациях, вроде использования файлов отображаемых в память,
56которые требуют большие свободные области памяти.
57*/
58 _heapmin(); //-V530
59 HeapCompact(GetProcessHeap(), 0);
60#endif
61
62 if (g_pStringContainer)
63 g_pStringContainer->clean();
64 if (g_pSharedMemoryContainer)
65 g_pSharedMemoryContainer->clean();
66}
67
68void* xrMemory::mem_alloc(size_t size)
69{

Callers 7

restart_simulatorMethod · 0.80
loadMethod · 0.80
net_StopMethod · 0.80
loadMethod · 0.80
_DestroyMethod · 0.80
RunMethod · 0.80
_CreateMethod · 0.80

Calls 1

cleanMethod · 0.45

Tested by

no test coverage detected