From 3dae9ce165a9f234eb0ba370187d3e4c8194f8ed Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:55:04 +0200 Subject: [PATCH] feat: re-enable jemalloc for anvil --- crates/anvil/Cargo.toml | 16 +++------------- crates/anvil/src/anvil.rs | 2 -- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/crates/anvil/Cargo.toml b/crates/anvil/Cargo.toml index cdf7c2f9b188..254067d114f3 100644 --- a/crates/anvil/Cargo.toml +++ b/crates/anvil/Cargo.toml @@ -16,11 +16,7 @@ path = "src/anvil.rs" required-features = ["cli"] [build-dependencies] -vergen = { workspace = true, default-features = false, features = [ - "build", - "git", - "gitcl", -] } +vergen = { workspace = true, default-features = false, features = ["build", "git", "gitcl"] } [dependencies] # foundry internal @@ -81,11 +77,7 @@ rand = "0.8" eyre.workspace = true # cli -clap = { version = "4", features = [ - "derive", - "env", - "wrap_help", -], optional = true } +clap = { version = "4", features = ["derive", "env", "wrap_help"], optional = true } clap_complete = { version = "4", optional = true } chrono.workspace = true auto_impl = "1" @@ -112,6 +104,4 @@ default = ["cli"] cmd = ["clap", "clap_complete", "ctrlc", "anvil-server/clap"] cli = ["tokio/full", "cmd", "fdlimit"] asm-keccak = ["alloy-primitives/asm-keccak"] -# TODO: parity dependencies are not compatible with a different global allocator. -# jemalloc = ["dep:tikv-jemallocator"] -jemalloc = [] +jemalloc = ["dep:tikv-jemallocator"] diff --git a/crates/anvil/src/anvil.rs b/crates/anvil/src/anvil.rs index 54a5e41cf55e..1aa204587b20 100644 --- a/crates/anvil/src/anvil.rs +++ b/crates/anvil/src/anvil.rs @@ -4,8 +4,6 @@ use anvil::cmd::NodeArgs; use clap::{CommandFactory, Parser, Subcommand}; use foundry_cli::utils; -// TODO: parity dependencies are not compatible with a different global allocator. -#[cfg(any())] #[cfg(all(feature = "jemalloc", unix))] #[global_allocator] static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;