Skip to content

Commit

Permalink
feat: jemalloc by default on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
joske authored and howardwu committed Mar 23, 2024
1 parent 3affa87 commit c4ecc09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ name = "snarkos"
path = "snarkos/main.rs"

[features]
jemalloc = [ "tikv-jemallocator" ]
metrics = [ "snarkos-node-metrics", "snarkos-node/metrics" ]

[dependencies.anyhow]
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions snarkos/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c4ecc09

Please sign in to comment.