-
Notifications
You must be signed in to change notification settings - Fork 5k
Start mimalloc's scavenger thread explicitly at startup #34502
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
🟡 The PR title and description still say this "binds the new
mi_scavenger_start(), and calls it early inmain", but commit 1cb1f7a ("Reduce to a plain mimalloc bump") removed both the binding and the startup call — the net diff is now just the mimalloc commit-hash bump and the matchingprocess.versionsexpectation. Since the description becomes the permanent squash-commit message (per.claude/docs/landing-prs.md, PR process: "Re-sync title/description whenever review reworks the change"), the title/description should be updated to reflect that this is now a plain mimalloc pin bump before merging.Extended reasoning...
What the finding is
The PR title is "Start mimalloc's scavenger thread explicitly at startup" and the description says it "bumps the mimalloc pin, binds the new
mi_scavenger_start(), and calls it early inmain— right after the signal setup". However, the second commit on this branch — 1cb1f7a "Reduce to a plain mimalloc bump" — removed both themi_scavenger_start()FFI binding and the startup call, so the PR title and description no longer describe what the PR actually does.Step-by-step proof
mi_scavenger_start()extern declaration insrc/mimalloc_sys/mimalloc.rssrc/bun_bin/lib.rsafter signal setupMIMALLOC_COMMITbump inscripts/build/deps/mimalloc.tsprocess.versions.mimallocexpectation update intest/js/node/process/process.test.jsgit diff a2152850..HEAD --stat):src/bun_bin/lib.rsandsrc/mimalloc_sys/mimalloc.rsare not touched.git grep mi_scavenger_start src/returns no matches — the binding is gone from the tree.So the delivered change is exactly: bump the pinned mimalloc commit from
24211c6…to4751881…and update the corresponding test expectation. Nothing about scavenger startup is changed on the Bun side; per the 1cb1f7a commit message, mimalloc at the new pin still auto-starts its scavenger during process init.Why this matters
The repo's own PR-process rules (
.claude/docs/landing-prs.md, referenced from REVIEW.md) state:If this merges as-is, the squash commit on
mainwill be titled "Start mimalloc's scavenger thread explicitly at startup" and its body will describe bindingmi_scavenger_start()and calling it inmain— none of which is present in the merged diff. Anyone later bisecting a scavenger-related regression, or readinggit logto understand when/why explicit scavenger startup was added, would be misled: this commit does not add an explicit startup call. The description's second paragraph ("Without the call, purging quietly falls back to being allocation-driven…") is also now factually wrong for this PR, since there is no call and — per the 1cb1f7a message — none is needed.What existing safeguards missed
CodeRabbit's "Title check" and "Description check" both passed, but they were run against commit f82b780 — before 1cb1f7a landed and dropped the change the title/description describe. Nothing re-validated the metadata after the rework commit.
Impact
No runtime, correctness, or build impact — the code that ships is fine. The only consequence is a misleading permanent squash-commit message in
main's history. That's why this is filed as a nit, not a merge blocker.Fix
Retitle to something like "Bump mimalloc to 4751881" (or similar) and rewrite the description to say what the net diff does: bump the pinned oven-sh/mimalloc commit and update the
process.versions.mimalloctest expectation. If it's useful context, note that the new pin keeps the scavenger auto-starting during process init so no Bun-side change is needed.