From e13c5ce056818ee8cd39b8f044ee4b1908024bd5 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Fri, 11 Jun 2021 07:02:47 -0400 Subject: [PATCH] Make mimalloc optional What? ===== mimalloc significantly reduces execution time in local benchmarking, but may be causing problems with ARM architectures (specifically the MBP M1s). This shifts mimalloc from a hard dependency to a feature flag which can be configured during install. --- Cargo.toml | 2 +- src/bin/unused.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 83c39f4..b8a5dfd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ read_ctags = { path = "crates/read_ctags/" } token_search = { path = "crates/token_search/" } codebase_files = { path = "crates/codebase_files/" } cli = { path = "crates/cli/" } -mimalloc = { version = "*", default-features = false } +mimalloc = { version = "*", default-features = false, optional = true } [[bin]] name = "read-ctags-rs" diff --git a/src/bin/unused.rs b/src/bin/unused.rs index 7fecf81..d7961ef 100644 --- a/src/bin/unused.rs +++ b/src/bin/unused.rs @@ -1,4 +1,4 @@ -#[cfg(all(unix, not(target_env = "musl")))] +#[cfg(all(feature = "mimalloc", unix, not(target_env = "musl")))] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;