Repository navigation
Conversation
The new commit adds an export that nothing calls yet, and a flag in padding of mi_tld_t. oven-sh/WebKit#911 is the caller. MIMALLOC_COMMIT is the head of oven-sh/mimalloc#62. It moves to the merged commit before this lands.
Collaborator
Author
|
Updated 3:27 AM PT - Oct 27th, 2026
✅ @robobun, your commit 451f7c4e891063940c82cdbc826592bf0db7382e passed in 🧪 To try this PR locally: bunx bun-pr 47042That installs a local version of the PR into your bun-47042 --bun |
This was referenced Oct 27, 2026
This branch has not been deployed
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.
Behaviour change: none
Problem
mi_on_thread_idle_pending_own, which mimalloc does not have at the commit thatmainpins (92ef6587). A WebKit archive with that change leaves the symbol undefined.Fix
MIMALLOC_COMMITto theap: mi_on_thread_idle_pending_own, for a thread that comes back only for its own large pages mimalloc#62, alone, before the WebKit change. It adds the export and one flag in padding ofmi_tld_t.sizeof(mi_tld_t)stays 248, andmi_mallocandmi_freecompile to the same bytes.test/js/bun/jsc(312 pass),test/js/bun/wasm,test/js/web/atomics.test.tsandtest/js/web/workers(444 pass). mimalloc's own suite passes 41 of 41 with the new test cases.Background
mi_on_thread_idle()is the sweep a thread makes when it goes idle. It leaves the free blocks of a large page that was just in use, andmi_on_thread_idle_pending()says so. The new answer is true only when such a page belongs to the calling thread.Downsides
.textgrows by 139 bytes, 697 of 703 code sections are identical, and an idle sweep makes two more byte stores.