MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / GcCompactTransientWindowBuffers

Method GcCompactTransientWindowBuffers

plugins/Cardinal/src/DearImGui/imgui.cpp:3156–3166  ·  view source on GitHub ↗

Free up/compact internal window buffers, we can use this when a window becomes unused. Not freed: - ImGuiWindow, ImGuiWindowSettings, Name, StateStorage, ColumnsStorage (may hold useful data) This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.

Source from the content-addressed store, hash-verified

3154// - ImGuiWindow, ImGuiWindowSettings, Name, StateStorage, ColumnsStorage (may hold useful data)
3155// This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.
3156void ImGui::GcCompactTransientWindowBuffers(ImGuiWindow* window)
3157{
3158 window->MemoryCompacted = true;
3159 window->MemoryDrawListIdxCapacity = window->DrawList->IdxBuffer.Capacity;
3160 window->MemoryDrawListVtxCapacity = window->DrawList->VtxBuffer.Capacity;
3161 window->IDStack.clear();
3162 window->DrawList->_ClearFreeMemory();
3163 window->DC.ChildWindows.clear();
3164 window->DC.ItemWidthStack.clear();
3165 window->DC.TextWrapPosStack.clear();
3166}
3167
3168void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window)
3169{

Callers

nothing calls this directly

Calls 2

_ClearFreeMemoryMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected