MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / GcCompactTransientWindowBuffers

Method GcCompactTransientWindowBuffers

lib/imgui/imgui.cpp:2738–2750  ·  view source on GitHub ↗

Free up/compact internal window buffers, we can use this when a window becomes unused. This is currently unused by the library, but you may call this yourself for easy GC. 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 c

Source from the content-addressed store, hash-verified

2736// - StateStorage, ColumnsStorage (may hold useful data)
2737// This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.
2738void ImGui::GcCompactTransientWindowBuffers(ImGuiWindow* window)
2739{
2740 window->MemoryCompacted = true;
2741 window->MemoryDrawListIdxCapacity = window->DrawList->IdxBuffer.Capacity;
2742 window->MemoryDrawListVtxCapacity = window->DrawList->VtxBuffer.Capacity;
2743 window->IDStack.clear();
2744 window->DrawList->ClearFreeMemory();
2745 window->DC.ChildWindows.clear();
2746 window->DC.ItemFlagsStack.clear();
2747 window->DC.ItemWidthStack.clear();
2748 window->DC.TextWrapPosStack.clear();
2749 window->DC.GroupStack.clear();
2750}
2751
2752void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window)
2753{

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
ClearFreeMemoryMethod · 0.45

Tested by

no test coverage detected