Skip to content

Commit e1c7e92

Browse files
hinshunevmar
authored andcommitted
Move jemalloc to crate feature to make it optional
1 parent 53ec691 commit e1c7e92

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ features = [
3232
]
3333

3434
[target.'cfg(not(any(windows, target_arch = "wasm32")))'.dependencies]
35-
jemallocator = "0.5.0"
35+
jemallocator = { version = "0.5", optional = true }
3636

3737
[dev-dependencies]
3838
divan = "0.1.16"
@@ -51,4 +51,6 @@ name = "canon"
5151
harness = false
5252

5353
[features]
54+
default = ["jemalloc"]
55+
jemalloc = ["jemallocator"]
5456
crlf = []

src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ mod terminal;
2424
mod trace;
2525
mod work;
2626

27+
#[cfg(feature = "jemalloc")]
2728
#[cfg(not(any(miri, windows, target_arch = "wasm32")))]
2829
use jemallocator::Jemalloc;
2930

31+
#[cfg(feature = "jemalloc")]
3032
#[cfg(not(any(miri, windows, target_arch = "wasm32")))]
3133
#[global_allocator]
3234
static GLOBAL: Jemalloc = Jemalloc;

0 commit comments

Comments
 (0)