MCPcopy Create free account
hub / github.com/RenderKit/embree / GcCompactTransientWindowBuffers

Method GcCompactTransientWindowBuffers

tutorials/common/imgui/imgui.cpp:3487–3497  ·  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

3485// - ImGuiWindow, ImGuiWindowSettings, Name, StateStorage, ColumnsStorage (may hold useful data)
3486// This should have no noticeable visual effect. When the window reappear however, expect new allocation/buffer growth/copy cost.
3487void ImGui::GcCompactTransientWindowBuffers(ImGuiWindow* window)
3488{
3489 window->MemoryCompacted = true;
3490 window->MemoryDrawListIdxCapacity = window->DrawList->IdxBuffer.Capacity;
3491 window->MemoryDrawListVtxCapacity = window->DrawList->VtxBuffer.Capacity;
3492 window->IDStack.clear();
3493 window->DrawList->_ClearFreeMemory();
3494 window->DC.ChildWindows.clear();
3495 window->DC.ItemWidthStack.clear();
3496 window->DC.TextWrapPosStack.clear();
3497}
3498
3499void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window)
3500{

Callers

nothing calls this directly

Calls 2

_ClearFreeMemoryMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected