Skip to content

Dev main#1332

Merged
daanx merged 53 commits into
mainfrom
dev-main
Jul 15, 2026
Merged

Dev main#1332
daanx merged 53 commits into
mainfrom
dev-main

Conversation

@daanx

@daanx daanx commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Release v3.4.1

daanx and others added 30 commits May 3, 2026 17:06
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.
fix(osx): implement introspect.reinit_lock to avoid fork() crash
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>
@daanx daanx merged commit 76d3f8a into main Jul 15, 2026
17 of 46 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.

4 participants