Compact and remove unused settings data (currently only used by TestEngine)
| 3568 | |
| 3569 | // Compact and remove unused settings data (currently only used by TestEngine) |
| 3570 | void 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 |
nothing calls this directly
no test coverage detected