Repository navigation
Make mimalloc a default Cargo feature - #580
Merged
tinder-maxwellelliott merged 1 commit intoOct 27, 2026
Merged
tinder-maxwellelliott merged 1 commit into
tinder-maxwellelliott merged 1 commit into
Conversation
Allow builders to select the system allocator while keeping mimalloc in ordinary Cargo and Bazel builds. Derive the Bazel binary features from the root Cargo package so its defaults stay in sync. Codex for Tamir.
tamird
force-pushed
the
codex/bazel-diff-gnu-system-allocator-20261027
branch
from
October 27, 2026 15:22
8770517 to
476e09a
Compare
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.
GNU/Linux builders currently have to edit
main.rsto compare glibc with mimalloc on their own workloads. The static musl benchmark leaves that choice open. The earlier public dependency-dense fixture favored mimalloc. Original allocator benchmarksMake
mimallocan optional Cargo dependency with a default-enabled feature of the same name. Ordinary Cargo and Bazel builds continue to use mimalloc, including the static musl release. Omitting the feature selects Rust’s system allocator on the target platform.Cargo users can pass
--no-default-features --features vendored-protocto retain the other default feature. The repository’s Bazel binary reads Cargo’s resolved features and accepts--features=-mimallocto remove just the allocator feature. A consumer with its ownrust_binarydeclaration can omitmimallocfrom that target’scrate_features.The GNU/Linux default binary’s vector growth calls
mi_malloc_aligned. The binary built with--features=-mimalloccalls glibc’smallocandposix_memalign. The static musl default still links mimalloc.On arm64 macOS, both settings produced identical hash and edge files from the 26,448,878-byte public fixture. The 192 Rust tests, 21 CLI tests and format check passed with each setting. Fixture and reproduction script
Reproduce the GNU/Linux builds
On a GNU/Linux host, run
python3 reproduce.py "$out/default" "$out/system"using the published fixture scripts from #577.Codex for Tamir.