Skip to content

Commit

Permalink
fix malloc conf usage in windows (MystenLabs#3134)
Browse files Browse the repository at this point in the history
* fix jemalloc usage in windows

* fix jemalloc usage in windows
  • Loading branch information
patrickkuo authored Jul 12, 2022
1 parent 4abe318 commit 5304d4e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/sui-benchmark/src/bin/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ use jemallocator::Jemalloc;
static GLOBAL: Jemalloc = Jemalloc;

fn main() {
use jemalloc_ctl::config;
let malloc_conf = config::malloc_conf::mib().unwrap();
println!("Default Jemalloc conf: {}", malloc_conf.read().unwrap());
#[cfg(not(target_env = "msvc"))]
malloc_conf();

let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));
let subscriber_builder =
Expand Down Expand Up @@ -74,6 +73,13 @@ fn main() {
println!("{}", r);
}

#[cfg(not(target_env = "msvc"))]
fn malloc_conf() {
use jemalloc_ctl::config;
let malloc_conf = config::malloc_conf::mib().unwrap();
println!("Default Jemalloc conf: {}", malloc_conf.read().unwrap());
}

fn running_mode_pre_check(benchmark: &bench_types::Benchmark) {
match benchmark.running_mode {
bench_types::RunningMode::SingleValidatorThread => {}
Expand Down

0 comments on commit 5304d4e

Please sign in to comment.