Skip to content

Commit c3cfb96

Browse files
committed
Use jemalloc on macOS
1 parent 2fb82be commit c3cfb96

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

Cargo.lock

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ itertools = "*"
2020
smallvec = { version = "1.7.0", features = ["union"] }
2121
bitflags = "*"
2222

23+
[target.'cfg(target_os = "macos")'.dependencies]
24+
jemallocator = { version = "0.3.2", features = ["disable_initial_exec_tls"] }
25+
2326
[build-dependencies]
2427
napi-build = { version = "1" }

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ extern crate itertools;
99
extern crate smallvec;
1010
extern crate bitflags;
1111

12+
#[cfg(target_os = "macos")]
13+
#[global_allocator]
14+
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
15+
1216
mod parser;
1317
mod rules;
1418
mod declaration;

0 commit comments

Comments
 (0)