From 88512695855c23d3d84216c692ff58a6d78e76c2 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 9 Feb 2024 09:41:27 +0800 Subject: [PATCH] fix: do not use jemalloc on macOS and Windows --- yazi-fm/Cargo.toml | 2 ++ yazi-fm/src/main.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index ef2b5561..07523196 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -37,6 +37,8 @@ tracing-subscriber = "^0" [target."cfg(unix)".dependencies] libc = "^0" signal-hook-tokio = { version = "^0", features = [ "futures-v0_3" ] } + +[target.'cfg(all(not(target_os = "macos"), not(target_os = "windows")))'.dependencies] tikv-jemallocator = "^0" [[bin]] diff --git a/yazi-fm/src/main.rs b/yazi-fm/src/main.rs index f8e54120..f1c0086c 100644 --- a/yazi-fm/src/main.rs +++ b/yazi-fm/src/main.rs @@ -1,7 +1,7 @@ #![allow(clippy::module_inception)] #![allow(clippy::unit_arg)] -#[cfg(unix)] +#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))] #[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;