From 3276178532e5013d2019da9db7c07d52a97c6a5f Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Tue, 5 Mar 2024 09:52:11 +0100 Subject: [PATCH 1/2] feat: jemalloc by default on linux --- Cargo.toml | 6 ++---- snarkos/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 76177a3d83..e8e3e82f87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,6 @@ name = "snarkos" path = "snarkos/main.rs" [features] -jemalloc = [ "tikv-jemallocator" ] metrics = [ "snarkos-node-metrics", "snarkos-node/metrics" ] [dependencies.anyhow] @@ -120,9 +119,8 @@ version = "=2.2.7" path = "./node/tcp" version = "=2.2.7" -[dependencies.tikv-jemallocator] -version = "0.5" -optional = true +[target.'cfg(target_os = "linux")'.dependencies] +tikv-jemallocator = "0.5" [dev-dependencies.rusty-hook] version = "0.11.2" diff --git a/snarkos/main.rs b/snarkos/main.rs index 64cef2f182..6ace71ef93 100644 --- a/snarkos/main.rs +++ b/snarkos/main.rs @@ -17,10 +17,10 @@ use snarkos_cli::{commands::CLI, helpers::Updater}; use clap::Parser; use std::process::exit; -#[cfg(feature = "jemalloc")] +#[cfg(target_os = "linux")] use tikv_jemallocator::Jemalloc; -#[cfg(feature = "jemalloc")] +#[cfg(target_os = "linux")] #[global_allocator] static GLOBAL: Jemalloc = Jemalloc; From a8f885e7c4d0cbd7990f32bfb9b620d752b61a12 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Thu, 7 Mar 2024 21:43:18 +0100 Subject: [PATCH 2/2] fix: x86_64 only --- Cargo.toml | 2 +- snarkos/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e8e3e82f87..631f31be53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,7 +119,7 @@ version = "=2.2.7" path = "./node/tcp" version = "=2.2.7" -[target.'cfg(target_os = "linux")'.dependencies] +[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dependencies] tikv-jemallocator = "0.5" [dev-dependencies.rusty-hook] diff --git a/snarkos/main.rs b/snarkos/main.rs index 6ace71ef93..61a86949b8 100644 --- a/snarkos/main.rs +++ b/snarkos/main.rs @@ -17,10 +17,10 @@ use snarkos_cli::{commands::CLI, helpers::Updater}; use clap::Parser; use std::process::exit; -#[cfg(target_os = "linux")] +#[cfg(all(target_os = "linux", target_arch = "x86_64"))] use tikv_jemallocator::Jemalloc; -#[cfg(target_os = "linux")] +#[cfg(all(target_os = "linux", target_arch = "x86_64"))] #[global_allocator] static GLOBAL: Jemalloc = Jemalloc;