MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / TableGcCompactSettings

Method TableGcCompactSettings

KBotExt/imgui/imgui_tables.cpp:3570–3585  ·  view source on GitHub ↗

Compact and remove unused settings data (currently only used by TestEngine)

Source from the content-addressed store, hash-verified

3568
3569// Compact and remove unused settings data (currently only used by TestEngine)
3570void ImGui::TableGcCompactSettings()
3571{
3572 ImGuiContext& g = *GImGui;
3573 int required_memory = 0;
3574 for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
3575 if (settings->ID != 0)
3576 required_memory += (int)TableSettingsCalcChunkSize(settings->ColumnsCount);
3577 if (required_memory == g.SettingsTables.Buf.Size)
3578 return;
3579 ImChunkStream<ImGuiTableSettings> new_chunk_stream;
3580 new_chunk_stream.Buf.reserve(required_memory);
3581 for (ImGuiTableSettings* settings = g.SettingsTables.begin(); settings != NULL; settings = g.SettingsTables.next_chunk(settings))
3582 if (settings->ID != 0)
3583 memcpy(new_chunk_stream.alloc_chunk(TableSettingsCalcChunkSize(settings->ColumnsCount)), settings, TableSettingsCalcChunkSize(settings->ColumnsCount));
3584 g.SettingsTables.swap(new_chunk_stream);
3585}
3586
3587//-------------------------------------------------------------------------
3588// [SECTION] Tables: Debugging

Callers

nothing calls this directly

Calls 6

next_chunkMethod · 0.80
reserveMethod · 0.80
alloc_chunkMethod · 0.80
swapMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected