Skip to content

Commit

Permalink
Make mimalloc optional
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshuaclayton committed Jun 11, 2021
1 parent a8b9a74 commit e13c5ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/bin/unused.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit e13c5ce

Please sign in to comment.