Skip to content

Release v3.5.3 - #1407

Merged
Daan (daanx) merged 26 commits into
main3from
dev3
Sep 17, 2026
Merged

Daan (daanx) merged 26 commits into
main3from
dev3

Conversation

@daanx

Copy link
Copy Markdown
Collaborator

No description provided.

439dc27 moved `mi_process_setup_auto_thread_done` into
`mi_process_init_once` so it runs after `mi_thread_init` and can
associate the current theap with the thread-done key. It now runs
before `_mi_process_is_initialized = true`, and with
`MI_TLS_RECURSE_GUARD` (always on for `MI_TLS_MODEL_LOCAL` on macOS)
`_mi_theap_default()` still returns `_mi_theap_empty` at that point.
The new `mi_assert_internal(mi_theap_is_initialized(theap))` fires in
debug builds; release builds skip the association, so the first
thread's theap is again never passed to `_mi_thread_done`.

Repro (macOS): `cmake -DCMAKE_BUILD_TYPE=Debug -DMI_TLS_MODEL=LOCAL`
then `./mimalloc-test-api` aborts at process init on v3.5.2 and
passes on v3.5.1. Same with `-DMI_TLS_RECURSE_GUARD=ON` on Linux.

Set the flag before `mi_process_setup_auto_thread_done`; the theap is
fully initialized by then.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016srh5svTkqfW21zGcU6ht9
fix: safely free over-aligned small allocations
…read-done

Set _mi_process_is_initialized before mi_process_setup_auto_thread_done (fixes 439dc27 with MI_TLS_RECURSE_GUARD)
@daanx
Daan (daanx) merged commit 31d034d into main3 Sep 17, 2026
88 of 107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants