-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Removed temporary memory from the API #10390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also, I have an sdl2-compat change coming... |
include/SDL3/SDL_begin_code.h
Outdated
|
||
/* This is used to mark functions that return memory that need to be freed with SDL_free() */ | ||
#ifndef SDL_DECLSPEC_FREE | ||
#define SDL_DECLSPEC_FREE SDL_DECLSPEC SDL_MALLOC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't what SDL_MALLOC does. It doesn't mean "this allocates some memory that needs to be freed," but rather "this is an allocator function like malloc with certain rules." Among them, that the allocated memory is uninitialized and the compiler can optimize for that truth.
At least according to https://stackoverflow.com/questions/18485447/gcc-attribute-malloc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, okay, fixing shortly.
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this. So, we're largely going back to the original system, where the API returns allocated results and you free them. In addition, to solve the problems we originally wanted temporary memory for: * Short strings with a finite count, like device names, get stored in a per-thread string pool. * Events continue to use temporary memory internally, which is cleaned up on the next event processing cycle.
Yeah, let's merge this. What a long, strange trip this has been. |
Oy... |
MinGW x86 tests in CI have been failing after this: https://github.com/libsdl-org/SDL/actions/runs/10120759219/job/27990895461 |
|
Yep, I'm working on this now. |
I think what's happening here is that somewhere we're freeing a const string and returning undefined memory. I'm going to see if I can track this down.
Fixed
Fixed
Fixed
I'm not seeing the slowdown here, are you able to break at startup and see where it's spending time? |
This should be fixed in 9da58e9 |
I ran gprof and ~99% of the time is in SDLTest's Moving the symbol name formatting to |
Leaks of testautomaton on Linux
Leaks of testsprite on wine (Windows)
Leaks of testautomation on wine (Windows)
Also
|
… memory own ership change. (#xxxx, ocornut#7801) see libsdl-org/SDL#10390
… memory ownership change. (#xxxx, ocornut#7801) see libsdl-org/SDL#10390
… memory ownership change. (ocornut#8530, ocornut#7801) see libsdl-org/SDL#10390
… memory ownership change. (ocornut#8530, ocornut#7801) see libsdl-org/SDL#10390
… memory ownership change. (#8530, #7801) see libsdl-org/SDL#10390
* Amend 9bc5b04 to avoid using GImGui mid-function. * Selectable: Fixed horizontal label alignment when combined with using ImGuiSelectableFlags_SpanAllColumns. (#8338) * Amend 9bc5b04 with a shadowed variable warning fix. * ImFont: IndexLookup[] table hold 16-bit values even in ImWchar32 mode. * ImFont: compact comments in header section. * Fonts: OversampleH/OversampleV value defaults to 0 for automatic selection. * Fonts: OversampleH auto-selection uses 36 as heuristic for now. * Fixed build with IMGUI_ENABLE_FREETYPE (#8346) * Fixed parameter names to SetLastItemData() to align with current names. * Windows: Fixed IsItemXXXX() functions not working on append-version of EndChild(). (#8350) Also made some of the fields accessible after BeginChild() to match Begin() logic. * Windows: separating WindowItemStatusFlags from ChildItemStatusFlag, because IsItemXXX _after_ BeginChild()>Begin() shouldn't return last status emitted by e.g. EndChild() As IsItemXXX() after is specced as returning title bar data we don't want to lock ourselves up from adding them to child window (e.g. MDI idea using windows to host child windows). * TabBar: Internals: added TabItemSpacing(). (#8349, #3291) * Docking: move DockTabItemStatusFlags stuff next to its peers in DC structure. * Extracted PushPasswordFont() out of InputText code. * Error Handling, Debug Log: IMGUI_DEBUG_LOG_ERROR() doesn't need the extra variable. Amend 2360061 * Tables, Menus: Fixed using BeginTable() in menu layer (any menu bar). (#8355) * EndMainMenuBar doesn't attempt to restore focus when there's an active id. (#8355) I don't have a specific issue in mind but it seems sane to add that test. * Rename internal id for standardizing naming convention. "##menubar" -> "##MenuBar", "###NavWindowingList" -> "###NavWindowingOverlay" "###NavUpdateWindowing" one should have zero side effect on anyone. * Fixed zealous GCC warning. (#8355) Amend dfd1bc3 * Fixed zealous GCC warning. (#8355) Amend dfd1bc3 * Docking: fixed ImGuiWindowFlags_DockNodeHost/ImGuiWindowFlags_NavFlattened clash introduced by c38c18c just for 1.91.7 (#8357) * Error Handling: Recovery from missing EndMenuBar() call. (#1651) * Tables, Menus: Fixed tables or child windows submitted inside BeginMainMenuBar() being unable to save their settings. (#8356) Amend error handling (fa178f4) to avoid us setting ImGuiWindowFlags_NoSavedSettings on the wrong window. * Examples: SDL3: Fix for Emscripten platform (#8363) * Version 1.91.8 * Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explicit context variant. * Comments, minor alignments tweaks. * Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explicit context variant. - OOPS * Version 1.91.9 WIP * Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox(), RadioButton(), Selectable(). (#8370) Item is already made inactive at the time of calling MarkItemEdited(). Fix a604d4f * Backends: Metal: Fixed a crash on application resources. (#8367, #7419) [@anszom] * InputTextWithHint(): Fixed buffer overflow when user callback modifies the buffer contents in a way that alters hint visibility. (#8368) * Backends: WebGPU: add type alias for dawn WGPUProgrammableStageDescriptor -> WGPUComputeState. (#8369) * ImFont: remove SetGlyphVisible() Which was never marked public. Added by d284a6c. (#2149, #515) Making room by removing stuff that are inconvenient to implement in our scaling system. If you were using this function please post an issue to report it. * (Breaking) Fonts: removed ImFontConfig::GlyphExtraSpacing option which seems largely obsolete and unused. (#242) * Backends: GLFW: Added comment about io.AddMouseSourceEvent() not being properly called. (#8374) * Add ImFontConfig::GlyphExtraAdvanceX as a replacement for GlyphExtraSpacing.x (#242) Partly restore 1a31e31. * Scrollbar: Rework logic that fades-out scrollbar when it becomes too small. Amend 0236bc2 * Fixed tabs and spaces (#8377) * Fonts: removed unnecessary const qualifier from ImFont::FindGlyph() Amend 0bde57c * Windows, Style: Added style.WindowBorderHoverPadding setting to configure inner/outer padding applied to hit-testing of windows borders. Amend 3c7177c, 59f3c4f, ae7f833. Could be latched inside windows to be multi-dpi friendly, but likely won't matter soon. * Internals: rename ImGuiNextWindowData::Flags to HasFlags for consistency and to reduce mistakes. * Tables: a clipped scrolling table correctly clears SetNextWindowXXX flags. (#8196) Amend 43c51eb * Tables: sneakily honor ImGuiNextWindowDataFlags_HasChildFlags/ImGuiNextWindowDataFlags_HasWindowFlags as a way to facilitate various hacks/workarounds. * Fix typo (#8382) * Demo: Combos: demonstrate a very simple way to add a filter to a combo. (#718) * TextLinkOpenurl(""): fixed default Win32 io.PlatformOpenInShellFn handler to handle UTF-8 regardless of system regional settings. (#7660) * Backends: SDL2, SDL3: Using SDL_Openurl("") in platform_io.Platform_OpenInShellFn handler. (#7660) * Fixed minor warning. Added comment. * Tables: fixed an issue where Columns Visible/Hidden state wouldn't be correctly overridden when hot-reloading .ini state. (#7934) * Windows: Fixed an issue where BeginChild() inside a collapsed Begin() wouldn't inherit the SkipItems flag. Amend/fix a89f05a (old!) Discovered while looking at glyph being processed in WIP branch. * InputText: Allow CTRL+Shift+Z to redo even outside of OSX. (#8389) * Examples: Win32+DirectX12: Fixed ExampleDescriptorHeapAllocator overflow free index. Amend 40b2286. * Styles, Tabs: (Breaking) Renamed TabMinWidthForCloseButton to TabCloseButtonMinWidthUnselected. Added TabCloseButtonMinWidthSelected. (#8387) * Styles, Tabs: Fixed ef7ffaf. (#8387) * Tables: tamed some .ini settings optimizations to more accurately allow overwriting/hot-reloading settings. (#7934) * Fixed static analyzer warning. (was harmless as initialized in NewFrame) * Backends: SDL2: Fixed build for versions older than 2.0.14. (#7660) * Docs: Update doc about plutosvg (#8395) * Viewports: default to first monitor is viewport is outside bounds. (#8393, #8385) Before the assert was introduced in d66f4e5 the viewport would be eventually clamped with ClampWindowPos using g.FallbackMonitor, but code would run temporarly with DpiScale=0. * Backends: Vulkan: Added ApiVersion field in ImGui_ImplVulkan_InitInfo. Dynamic rendering path loads "vkCmdBeginRendering/vkCmdEndRendering" without -KHR on API 1.3. (#8326, #8365) * Examples: Vulkan: make ApiVersion a little more visible in examples. (#8326, #8365) * Backends: Vulkan: Fixed building with older headers not supporting VK_HEADER_VERSION_COMPLETE. (#8326, #8365) * Tables, Error Handling: Recovery from invalid index in TableSetColumnIndex(). (#1651) * Viewports: Fixed assertion when multi-viewports disabled and no monitor submitted. Reworked 95c4111. (#8401, #8393, #8385) * Backends: Vulkan: Fixed crash with using no prototypes + *BREAKING* Added ApiVersion to ImGui_ImplVulkan_LoadFunctions(). (#8326, #8365, #8400) * ImFont: simpler constructor. * Selectable: Fixed horizontal label alignment with SelectableTextAlign.x > 0 and specifying a selectable size. (#8338) Regression from ed7551c * ImDrawList: added InitialFringeScale in ImDrawListSharedData. Default to 1.0f. This is to allow some DPI mods with less changes. Only the initial value in SetupDrawListSharedData() will need change. * Tabs: fixed middle-button to close not checking hovering, only close button visibility. (#8399, #8387) Main bug has been here since 54a60aa, but it's only ef7ffaf which made it very visible. * Backends: OpenGL3: Lazily reinitialize embedded GL loader for when calling backend from e.g. other DLL boundaries. (#8406) * Added ImGuiMouseCursor_Wait mouse cursor (busy/wait/hourglass shape) + support in SDL2,SDL3,Win32,Allegro5 backends. * Added ImGuiMouseCursor_Progress mouse cursor 8a35386+ support in SDL2,SDL3,Win32,Allegro5 backends. Amend 8a35386 * Tables: fixed an issue where Columns Width state wouldn't be correctly restored when hot-reloading .ini state. (#7934) Amend 7cd31c3 column->SortDirection initialized setting was wrong in first block but without side-effect, since sorting always stored explicitly in .ini data. * Tables: share code between TableSetupColumn() and TableLoadSettings(). (#7934) * Hot-fix for broken MouseDrawCursor support for ImGuiMouseCursor_Wait/ImGuiMouseCursor_Progress/ImGuiMouseCursor_NotAllowed. Amend 8a35386, eec097f. * ImFontAtlas: added software/drawlist version of ImGuiMouseCursor_Wait/ImGuiMouseCursor_Progress + moved GetMouseCursorTexData() to internals. * Examples: Android: Update kotlin version (#8409) * Examples: GLFW+Vulkan: make GLFW_DIR overridable in cmake bit. (#8419) * Backends: Win32: WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (#8415) * Backends: GLFW/SDL2/SDL3: Update monitors and work areas information every frame, as the later may change regardless of monitor changes. (#8415) * Internals: packing ImGuiDataVarInfo + misc renaming + value of ImGuiDataType_Pointer doesn't need to be Count+1 * Backends: Win32: use UnregisterClassW() for matching consistency. (#8423, #7979) Amend 3293ef8 * Viewports + Backends: Win32: Fixed setting title bar text when application is compiled without UNICODE. (#7979, #5725) * Nav: extract code into a NavUpdateWindowingApplyFocus() so it may be reused elsewhere. * Fix typos in docs (#8427) * Backends: DirectX11: configure swap chain creation for secondary viewports via undocumented ImGui_ImplDX11_SetSwapChainDescs(). (#5437, #7607, #7286, #2970) * Backends: DirectX12: Fixed an issue where pre-1.91.5 legacy ImGui_ImplDX12_Init() signature started breaking in 1.91.8 due to missing command queue. (#8429) * Tabs: fixed Unsaved Marker not being visible when Close Button is. (#8430, #8387) * Backends: SDL2, SDL3: don't call SDL_GetGlobalMouseState() when mouse position is in relative mode. (#8425, #8407) * Debug Tools: Added io.ConfigDebugHighlightIdConflictsShowItemPicker. (#7961, #7669) * Backends: fixed comment to state that ImGuiViewport::PlaformHandle is used to store SDL's WindowID, not SDL_Window*. (#7853) Amend 2d99052 * Internals: added IsItemActiveAsInputText() helper. * Backends: SDL2, SDL3: Use display bounds when SDL_GetDisplayUsableBounds() fails or return a zero size. (#8415, #3457) Analoguous to aa8e09d for GLFW. * Font: shallow refactor, rename ConfigData[] fields to Sources[], ConfigDataCount to SourcesCount. In theory this is all internal stuff. * Examples: SDL3+SDL_Renderer: removed reference to OpenGL to remove confusion. (#8434) * Examples: SDL3+SDL_Renderer: removed reference to OpenGL to remove confusion. (#8434) Amend * Backends: WebGPU: update code for latest webgpu-native changes. (#8426) * Backends: WebGPU: update code for latest webgpu-native changes. Amend. (#8426) * Backends: WebGPU: update code for latest webgpu-native changes. Fix for Emscripten. (#8426) * Backends: WebGPU: Recreate image bind groups during render. (#8426, #8046, #7765, #8027) * Backends: SDL2, SDL3: Only start SDL_CaptureMouse() when mouse is being dragged. (#6410, #3650) To mitigate issues with e.g. Linux debuggers not claiming capture back. * Backends: WebGPU: include imgui.h before backend check (#8437) * Backends: WebGPU: Add nextInChain field for VertexAttributes under Dawn (#8438) * Image: removed 'tint_col', 'border_col' parameters from Image(). Added ImageWithBg(). Added style.ImageBorderSize, ImGuiStyleVar_ImageBorderSize. (#8131, #8238) Displaying a black background behind Font Atlas texture. * Internals: rename ImGuiDataVarInfo to ImGuiStyleVarInfo. Move ImGuiStyleMod, ImGuiColorMod to own section. # Conflicts: # imgui.cpp * Misc shallow tweaks/tidying up. (#8446) * ShowFontAtlas() uses ImageWithBg(). (#8131, #8238) Amend 494ea57 * TextLink(), TextLinkOpenurl(""): fixed honoring text baseline alignment. (#8451, #7660) * Clipper: Fixed an issue where passing an out of bound index to IncludeItemByIndex() could incorrectly offset the final cursor. One case where it would manifest was calling Combo() with an out of range index. (#8450) * Backends: GLFW: Fixed clipboard handler assertion when using GLFW <= 3.2.1 compiled with asserts enabled. (#8452) Amend 8e40104 * Demo: (Refactor) Added new empty sections.. Renamed existing helper functions. * Demo: (Refactor) Moved code into DemoWindowWidgetsBasic() section. * Demo: (Refactor) Moved code into DemoWindowWidgetsTooltips(), DemoWindowWidgetsTreeNodes() sections. * Demo: (Refactor) Moved code into DemoWindowWidgetsBullets(), DemoWindowWidgetsCollapsingHeaders(), DemoWindowWidgetsCollapsingText() sections. * Demo: (Refactor) Moved code into DemoWindowWidgetsComboBoxes(), DemoWindowWidgetsImages(), DemoWindowWidgetsListBoxes() sections. * Demo: (Refactor) Moved code into DemoWindowWidgetsSelectables(), DemoWindowWidgetsTextFilter(), DemoWindowWidgetsTextInputs() sections. * Demo: (Refactor) Moved code into DemoWindowWidgetsPlotting(), DemoWindowWidgetsProgressBars(), DemoWindowWidgetsTabs() sections. * Demo: (Refactor) Moved code into DemoWindowWidgetsDataTypes() section. * Demo: (Refactor) Moved code into DemoWindowWidgetsColorAndPickers() section. * Demo: (Refactor) Moved code into DemoWindowWidgetsDragsAndSliders(), DemoWindowWidgetsMultiComponents(), DemoWindowWidgetsVerticalSliders() sections. * Demo: (Refactor) Moved code into DemoWindowWidgetsDragAndDrop() section. * Demo: (Refactor) Moved code into DemoWindowWidgetsQueryingStatuses() section. * Demo: (Refactor) Moved code into DemoWindowWidgetsDisableBlocks() section. * Disabled: Fixed an issue restoring Alpha in EndDisabled() when using nested BeginDisabled() calls with PushStyleVar(ImGuiStyleVar_DisabledAlpha) within. (#8454, #7640) * Examples: SDL3: Added comments to clarify setup for users of the unfortunate SDL_MAIN_USE_CALLBACKS feature. (#8455) * Demo: (Refactor) Moved DemoWindowWidgets() below the functions it calls, reducing amount of forward declarations. * Demo: (Refactor) Moved ExampleTreeNode contents below ShowDemoWindow() so main entry point is more visible to casual reader. * Debug Tools: Tweaked layout of ID Stack Tool and always display full path. (#4631) * Internals: Menus: reworked mangling of menu windows to use "###Menu_00" etc. instead of "##Menu_00". * Add proper ImGuiTextBuffer::resize() support other than 0. * Internals: added ImStrlen/ImMemchr #define to facilitate experimenting with variations. (#8421) * Set IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS on 3DS sdk (#8477, #8476) * Docs: Fix some typos (#8473) * Update FAQ.md for SDL3 (#8480) * Docking: removed legacy assert preventing to call DockBuilderSplitNode() on an existing split node. (#8472) * Backends: Win32, SDL2, SDL3, GLFW: prioritize scancodes instead of translated keycodes when dealing with OEM keys + Added ImGuiKey_Oem102. (#7136, #7201, #7206, #7306, #7670, #7672, #8468) * Amend Changelog to talk about OEM keys. (#7136, #7201, #7206, #7306, #7670, #7672, #8468) + more consistently use Ctrl+XXX instead of Ctrl-XXX. * Backends: Fixed zealous warnings. * Examples: Updated all .vcxproj from VS2015 to VS2019 (toolset v140 to v142), Windows SDK 8.1 to 10. * Viewports: fixed an issue where window repositioning leading to a monitor change could have the window incorrectly get clamped within the boundaries of its previous monitor. (#8484) * Added ImGuiKey_AbntC1, ImGuiKey_AbntC2 + Backends: GLFW, Win32: added support. (#8468) * Revert "Examples: Updated all .vcxproj from VS2015 to VS2019 (toolset v140 to v142), Windows SDK 8.1 to 10." This reverts commit 6da2306. * Backends: DX12: comment about using SrvDescriptorAllocFn/SrvDescriptorFreeFn. Amend 40b2286 * Tables: fixed an issue with TableSetupColumn() overriding ini data. (#7934) Amend 05742f9 * Scrollbar: stabilize visibility of ScrollbarX when detecting a feedback loop. (#8488, #3285, #4539) * Revert "Added ImGuiKey_AbntC1, ImGuiKey_AbntC2 + Backends: GLFW, Win32: added support. (#8468)" This reverts commit 557c77e. * InputText: Pasting a multi-line buffer into a single-line edit replaces carriage return by spaces. (#8459) * Misc: Various zealous warning fixes for newer version of Clang. * Version 1.91.9 * Fix typo in comment (#8494) * Docs: retroactively document ConfigData->Sources renaming. (#8495) Amend 4c0604e * Docs: Fixed typo. Very oops. (#8495) * Version 1.92.0 WIP * Moved ImDrawIdx definition lower in imgui.h. Moved ImTextureID slightly below in its own section. * Backtrack of version tagging 1.92.0 > 1.91.9b for publishing a hotfix (#8496) * Tables: fixed assert/issues loading settings. (#8496, #7934) Not sure what I did with 05742f9 but I missed on the primary filter. * Version 1.91.9b * Error Handling: added better report and recovery for extraneous EndPopup() call. (#1651, #8499) * Added comments about line/rect thickness needing scaling. (#7031) * Version 1.92.0 WIP * Style, InputText: added ImGuiCol_InputTextCursor to configure color of the InputText cursor/caret. (#7031) * Backends: SDL2, SDL3, OSX: Fill gamepad inputs and set ImGuiBackendFlags_HasGamepad regardless of ImGuiConfigFlags_NavEnableGamepad being set. (#8508) * IO: variations in analog-only components of gamepad events do not interfere with trickling of mouse position events (#4921, #8508) * Docs: Fix some typos (#8505) * Internals: made MousePos an argument of UpdateHoveredWindowAndCaptureFlags(). (#8431, #1152) * Backends: SDLGPU: Fixed typo in function name Imgui_ImplSDLGPU3_PrepareDrawData() -> ImGui_ImplSDLGPU3_PrepareDrawData(). (#8509, 8163, #7998, #7988) * Move Changelog entry. (#8509) * Windows: fixed SetNextWindowCollapsed()/SetWindowCollapsed() breaking codepath that preserve last contents size when collapsed. (#7691) * Added extra operators to ImVec4. (#8510) * Backends: Win32: Viewports: fixed an issue when closing a window from the OS close button (with io.ConfigViewportsNoDecoration=false) while user code is discarding the 'bool *p_open=false output' from Begin() * Backends: SDL3: Update for API changes: Revert SDL_GetClipboardText() memory ownership change. (#8530, #7801) see libsdl-org/SDL#10390 * Nav: polling gamepad for ImGuiKey_NavGamepadMenu use routing-friendly Shortcut() so Ctrl+Tab equivalent may be hijacked. (#8525, #4828, #3255, #5641) * Nav: added bool ConfigNavWindowingWithGamepad to disable windowing with gamepad. (#8525, #4828, #3255, #5641) * Nav: fixed assertion when holding gamepad FaceLeft/West button + pressing a keyboard key. (#8525) * Backends: SDLGPU3: Made ImGui_ImplSDLGPU3_PrepareDrawData() reuse GPU Transfer Buffers which were unusually slow to recreate every frame. (#8534) * Comments * Backends: Vulkan: Suppress trivially-copyable warning (#8537) * Docs: fixed link typo (#8538) * Fonts: fixed CalcWordWrapPositionA() fallback when width is too small to wrap with multibyte codepoints.. (#8540) * Fonts: word-wrapping code handle ideographic comma & full stop (U+3001, U+3002). (#8540) * TreeNode: adding ImGuiTreeNodeFlags_NoNavFocus in imgui_internal.h (#8551) * Backends: Vulkan: Deep-copy ImGui_ImplVulkan_InitInfo::PipelineRenderingCreateInfo's pColorAttachmentFormats buffer when set, in order to reduce common user-error of specifying a pointer to data that gets out of scope. (#8282) # Conflicts: # backends/imgui_impl_vulkan.cpp # docs/CHANGELOG.txt * Backends: Vulkan: Build and warning fixes. (#8282) * Windows: loosened code to handle ImGuiButtonFlags_FlattenChildren so that master matches docking. (#8554) This essentially merges 059560d back into master. * TreeNode: added ImGuiTreeNodeFlags_DrawTreeXXX flags. (#2920) # Conflicts: # docs/CHANGELOG.txt * TreeNode: Don't latch GetColorU32(ImGuiCol_TreeLines). (#2920) Trade off doesn't seem worth it for large trees. User who really needs to alter colors can do it by adjusting Push/Pop locations. * TreeNode: extracted TreeNodeDrawLineToChildNode() for usage by custom widgets (#2920) * Backends: SDL2/SDL3: revert updating monitors and work area info every frame. Workaround for Windows. (#8415, #8558) Partly revert logic from 1a7b594. * Backends: SDL2, SDL3: don't attempt to call SDL_CaptureMouse() on drivers where we don't call SDL_GetGlobalMouseState(). (#8561) * TreeNode: removed TreeLinesSize > 0.0f optimization check. (#2920) This is desirable but we'd need to avoid exposing 0.0f in style editor + assert on it. * TreeNode: DrawLines: latch X1 offset during TreePush(). (#2920) * TreeNode: DrawLines: tweak X2 offset to avoid losing line when ItemSpacing is large. (#2920) * TreeNode: fixed incorrect clipping of arrow/bullet when using ImGuiTreeNodeFlags_SpanAllColumns. * TreeNode, Tables: fixed ImGuiTreeNodeFlags_DrawLinesXXX feature when TreePop() is called from a different column. (#2920) * TreeNode: ImGuiTreeNodeFlags_DrawLinesFull uses ToNodes Y2 when they are close (using a threshold). (#2920) * TreeNode, Tables: fixed ImGuiTreeNodeFlags_DrawLinesXXX feature when TreePop() is called in table: in no column or at top of row. (#2920) * TreeNode: extract code out of TreePop() into TreeNodeDrawLineToTreePop(). (#2920) * TreeNode: fixed non-opened clipped child node not moving Y2 marker. (#2920) * TreeNode, Style: added style.TreeLinesRounding support. (#2920) * Backends: OSX: remove duplicate variable. (#8565) * Examples: added SDL2+Vulkan, SDL3+Vulkan, GLFW+Vulkan makefiles. Amend ignore list. (#2480) * Error Handling: added better error report and recovery when calling EndFrame() or Render() without NewFrame(). * Internals: minor refactor of TabItemLabelAndCloseButton(), should be no-op. (minor thing toward #7024) * ImFont: added cpu clip fine option for ImFont::RenderChar() (which is technically internal). (toward #7024) * Tabs: adjust handling of ellipsis now that Close Button visibility changed. (#8387) Internals: remove extra parameter to RenderTextEllipsis(). This requires RenderTextEllipsis() to use fine CPU-side clippoing. Users of RenderTextEllipsis(): #7024, #6236, #5267, #5745, #4269, #2775 * Fonts: reworked text ellipsis logic to ensure a "..." is always displayed instead of a single character. (#7024) Requires 97d8533 and e4a8651 * RenderTextEllipsis()): pixel align every dot for consistent display. * Backends: SDL_GPU: Added multi-viewport support. (#8573, #8163, #7998, #7988) * Backends: SDL_GPU: Added multi-viewport support. Amends + update example. (#8573, #8163, #7998, #7988) * Backends: DX12: build fix for Clang. (#8582) * Demo: rename DockingSplitterSize slider label to DockingSeparatorSize for consistency. (#8579) * Platform IME: added ImGuiPlatformImeData::WantTextInput, ViewportId. Backends: SDL3: honor WantTextInput. (#8584, #7492, #6341) * Platform IME: minor amend to bf0f586 (#8584) * Tables: fixed TableHeader() eager vertical clipping of text. (#6236) * Added wp TextAligned() TextAlignedV(), TextAlignedExV() to internal API. (#7024) * Rework TextAligned() api to take size input. (#7024) * Rework TextAligned() api to fix issues with baseline alignment + use standard CalcItemSize(). (#7024) * Viewports, Backends: Debug logging. * Backends: SDL2, SDL3: viewports created with ImGuiViewportFlags_NoInputs are passing SDL_WINDOW_TOOLTIP to SDL_CreateWindow(). (#8576) Which reduces issues related to losing key down state on focus loss. * Backends: SDLGPU3: clear ImGuiBackendFlags_RendererHasViewports flag on shutdown. * Revert "Backends: SDL2, SDL3: viewports created with ImGuiViewportFlags_NoInputs are passing SDL_WINDOW_TOOLTIP to SDL_CreateWindow(). (#8576)" This reverts commit 2a000ee. * Backends: GLFW: Disable multi-viewports under Wayland. (#8587) * added cmake file --------- Co-authored-by: ocornut <omar@miracleworld.net> Co-authored-by: ocornut <omarcornut@gmail.com> Co-authored-by: Konstantin Podsvirov <konstantin@podsvirov.pro> Co-authored-by: PhantomCloak <unalozyurtrooter@hotmail.com> Co-authored-by: fdsa <14tanks999@gmail.com> Co-authored-by: edenware <52419657+edenoftheware@users.noreply.github.com> Co-authored-by: PuPuHX <654524200@qq.com> Co-authored-by: Rémy Tassoux <contact@rt2.fr> Co-authored-by: Gabriel Rodriguez <gabrielrodriguez@mediamolecule.com> Co-authored-by: Nico van Bentum <niico0708@gmail.com> Co-authored-by: Tygyh <32486062+tygyh@users.noreply.github.com> Co-authored-by: David Maas <contact@pathogenstudios.com> Co-authored-by: Marius PvW <marius@taniustech.com> Co-authored-by: TheMode <themode@outlook.fr> Co-authored-by: Russ Gibson <russg@rnstech.com> Co-authored-by: Jose L. Hidalgo (PpluX) <joseluis.hidalgo@gmail.com> Co-authored-by: Alan <ahulambda@gmail.com> Co-authored-by: Zijie Wu <noojeff@gmail.com> Co-authored-by: MegaMech <MegaMech@users.noreply.github.com> Co-authored-by: Wizard <74285801+wizard00000@users.noreply.github.com> Co-authored-by: tanksdude <58898485+tanksdude@users.noreply.github.com> Co-authored-by: puugz <matej1.svetina@gmail.com> Co-authored-by: gan74 <gregoire.angerand@gmail.com> Co-authored-by: Green Sky <Green-Sky@users.noreply.github.com> Co-authored-by: Andrew Zonenberg <azonenberg@drawersteak.com> Co-authored-by: Shixian Sheng <shixian_sheng-2@protonmail.com> Co-authored-by: Zane van Iperen <zane@zanevaniperen.com> Co-authored-by: 519q <conspir8ed@gmail.com> Co-authored-by: Lekoopapaul <noEmail@null.com> Co-authored-by: Hinageshi <69386319+roeas@users.noreply.github.com>
It was intended to make the API easier to use, but various automatic garbage collection all had flaws, and making the application periodically clean up temporary memory added cognitive load to using the API, and in many cases was it was difficult to restructure threaded code to handle this.
So, we're largely going back to the original system, where the API returns allocated results and you free them.
In addition, to solve the problems we originally wanted temporary memory for: