From b1b334a17f77de7c229701038129097889da2423 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Fri, 19 Nov 2021 09:48:07 -0600 Subject: [PATCH] ledger-tool uses jemalloc like validator (#21351) --- Cargo.lock | 1 + ledger-tool/Cargo.toml | 3 +++ ledger-tool/src/main.rs | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index fbbc050904..fcf3b20a57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5152,6 +5152,7 @@ dependencies = [ "solana-transaction-status", "solana-version", "solana-vote-program", + "tikv-jemallocator", "tokio", ] diff --git a/ledger-tool/Cargo.toml b/ledger-tool/Cargo.toml index e4e6288202..8f46bdc7be 100644 --- a/ledger-tool/Cargo.toml +++ b/ledger-tool/Cargo.toml @@ -38,6 +38,9 @@ solana-version = { path = "../version", version = "=1.9.0" } solana-vote-program = { path = "../programs/vote", version = "=1.9.0" } tokio = { version = "1", features = ["full"] } +[target.'cfg(not(target_env = "msvc"))'.dependencies] +jemallocator = {package = "tikv-jemallocator", version = "0.4.1", features = ["unprefixed_malloc_on_supported_platforms"]} + [dev-dependencies] assert_cmd = "2.0" diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index a40eff3d0f..1fd2100c1f 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -833,6 +833,12 @@ fn assert_capitalization(bank: &Bank) { let debug_verify = true; assert!(bank.calculate_and_verify_capitalization(debug_verify)); } +#[cfg(not(target_env = "msvc"))] +use jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; #[allow(clippy::cognitive_complexity)] fn main() {