Skip to content

Refactor: abstract global allocator in foundry-cli to be used across crates #10523

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

Conversation

mablr
Copy link
Contributor

@mablr mablr commented May 15, 2025

Motivation

Resolve #10516 : Extract common global allocator initialization like in reth and solar.

Solution

Create an allocator submodule in foundry-cli crate for unified allocator initialization over all crates.

  • Conditional allocator type selection with cfg-if macro
  • Explicit use of std::alloc::System if feature "jemalloc" is not enabled
  • Linking "jemalloc" feature in all crates to "foundry-cli/jemalloc"

… crates

- Conditional allocator type selection with cfg-if macro
- Explicit use of `std::alloc::System` if feature "jemalloc" is not  enabled
- Linking "jemalloc" feature in all crates to "foundry-cli/jemalloc"
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@DaniPopes DaniPopes merged commit f37b4f0 into foundry-rs:master May 15, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Abstract global allocator
2 participants