MCPcopy Create free account
hub / github.com/Raais/ImStudio / GcCompactTransientWindowBuffers

Method GcCompactTransientWindowBuffers

src/third-party/imgui/imgui.cpp:3325–3335  ·  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

3323// - ImGuiWindow, ImGuiWindowSettings, Name, StateStorage, ColumnsStorage (may hold useful data)
3324// This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.
3325void ImGui::GcCompactTransientWindowBuffers(ImGuiWindow* window)
3326{
3327 window->MemoryCompacted = true;
3328 window->MemoryDrawListIdxCapacity = window->DrawList->IdxBuffer.Capacity;
3329 window->MemoryDrawListVtxCapacity = window->DrawList->VtxBuffer.Capacity;
3330 window->IDStack.clear();
3331 window->DrawList->_ClearFreeMemory();
3332 window->DC.ChildWindows.clear();
3333 window->DC.ItemWidthStack.clear();
3334 window->DC.TextWrapPosStack.clear();
3335}
3336
3337void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window)
3338{

Callers

nothing calls this directly

Calls 2

_ClearFreeMemoryMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected