Skip to content

Commit

Permalink
try jemalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jan 22, 2024
1 parent ea753f1 commit d7e2baf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ lazy_static = "1.4.0"
clap = { version = "4.4.18", features = ["derive"] }
bincode = "2.0.0-rc.3"

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.5"

[profile.release]
debug = true
8 changes: 8 additions & 0 deletions src/bin/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ use calx_vm::{log_calx_value, parse_function, Calx, CalxFunc, CalxImportsDict, C

use bincode::{Decode, Encode};

// main.rs
#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

/// binary format for saving calx program
/// TODO this is not a valid file format that requires magic code
#[derive(Debug, Clone, PartialEq, PartialOrd, Encode, Decode)]
Expand Down

0 comments on commit d7e2baf

Please sign in to comment.