Skip to content

Commit

Permalink
Jemallocator on linux gnu
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed May 7, 2022
1 parent 9f6050f commit af1b866
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion crates/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ version = "0.1.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[target.'cfg(all(not(target_env = "musl"), not(target_arch = "aarch64")))'.dependencies]
[target.'cfg(not(target_os = "linux"))'.dependencies]
mimalloc-rust = { version = "0.1" }

[target.'cfg(all(target_os = "linux", target_env = "musl"))'.dependencies]
tikv-jemallocator = { version = "0.4", features = ["disable_initial_exec_tls"] }
6 changes: 5 additions & 1 deletion crates/alloc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#[cfg(all(not(target_env = "musl"), not(target_arch = "aarch64")))]
#[cfg(not(target_os = "linux"))]
#[global_allocator]
static GLOBAL: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;

#[cfg(all(target_os = "linux", target_env = "gnu"))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

0 comments on commit af1b866

Please sign in to comment.