Skip to content

Commit

Permalink
Try not using jemalloc for musl
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Jun 17, 2024
1 parent bb5096b commit 0c60140
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unicode-segmentation = "1.11.0"
[target.'cfg(any(target_arch = "x86", target_arch = "x86_64", target_arch = "aarch64"))'.dependencies]
cpufeatures = "0.2"

[target.'cfg(not(any(target_env = "msvc", target_os = "macos", target_os = "android")))'.dependencies]
[target.'cfg(not(any(target_env = "msvc", target_env = "musl", target_os = "macos", target_os = "android")))'.dependencies]
tikv-jemallocator = { version = "0.5", features = ["background_threads", "unprefixed_malloc_on_supported_platforms"] }

[target.'cfg(target_os = "macos")'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ mod rpc;
mod server;
mod util;

#[cfg(not(any(target_env = "msvc", target_os = "android")))]
#[cfg(not(any(target_env = "msvc", target_env = "musl", target_os = "android")))]
#[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

// jemalloc config
#[cfg(not(target_env = "msvc"))]
#[cfg(not(any(target_env = "msvc", target_env = "musl")))]
#[no_mangle]
pub static mut malloc_conf: *const u8 = b"percpu_arena:phycpu,tcache:false,dirty_decay_ms:1000,muzzy_decay_ms:0\0".as_ptr();

Expand Down

0 comments on commit 0c60140

Please sign in to comment.