Conversation
The macOS malloc zone advertises version >= 9, for which libmalloc invokes introspect->reinit_lock from the atfork_child handler (_malloc_fork_child) without a NULL check. The introspection struct left reinit_lock unset (NULL), so any fork() in a process that statically links the mimalloc zone made the child jump to address 0 and crash (EXC_BAD_ACCESS at 0x0) on macOS 15. Provide a no-op reinit_lock: mimalloc has no zone-level locks to reinitialize after fork.
…better, see issue #1314
fix(osx): implement introspect.reinit_lock to avoid fork() crash
…d_free_partial, see issue #1317
Add RISC-V 64 TLS support and atomic yield functionality
The THP advise was gated on the caller's allow_large parameter, which callers derive from segment laziness and which primarily exists to gate MAP_HUGETLB. hugetlbfs pages are physically committed at map time, so keeping them away from lazily-committed segments makes sense, but transparent huge pages materialize on fault and have no such cost. As a result of sharing the gate, huge objects (the OS singleton path) and each thread's first segment were never eligible for THP under Linux's madvise THP mode even with allow_thp enabled. With this change the advise depends only on the allow_thp option, matching the effective behavior of the dev3 branch, where singleton pages are committed eagerly and allow_large no longer depends on laziness. In the mold linker, whose largest data structures allocate through the huge-object path, this makes linking a Chromium debug build about 2% faster (3.37s to 3.29s) on a 64-core machine, and 15% faster (4.05s to 3.43s) when mold runs in its single-process mode, where the process exit cost is user-visible and freeing a heap of 2 MiB folios is much cheaper than freeing millions of 4 KiB folios. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Advise MADV_HUGEPAGE independently of allow_large
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v3.4.1