From 1612f39b175786ffa9b1a061847b54808ee311dd Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Wed, 3 Jan 2024 14:58:23 +0900 Subject: [PATCH] Revert "disable jemalloc" This reverts commit 83fd21729976de9cf7b41e54374b4f475c3b9e24. --- Cargo.lock | 1 + ledger-tool/Cargo.toml | 3 +++ ledger-tool/src/main.rs | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 31f43150b22be1..b28fdd7794421c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6491,6 +6491,7 @@ dependencies = [ "solana-vote-program", "solana_rbpf", "thiserror", + "tikv-jemallocator", "tokio", ] diff --git a/ledger-tool/Cargo.toml b/ledger-tool/Cargo.toml index 1f0fb466419631..ddc1ca9b564e94 100644 --- a/ledger-tool/Cargo.toml +++ b/ledger-tool/Cargo.toml @@ -52,6 +52,9 @@ solana_rbpf = { workspace = true, features = ["debugger"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } +[target.'cfg(not(target_env = "msvc"))'.dependencies] +jemallocator = { workspace = true } + [dev-dependencies] assert_cmd = { workspace = true } bytecount = { workspace = true } diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index d0cf79e76edada..aeed93fd2ff46e 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -1062,6 +1062,13 @@ fn get_access_type(process_options: &ProcessOptions) -> AccessType { } } +#[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() { // Ignore SIGUSR1 to prevent long-running calls being killed by logrotate