Skip to content

Commit b34cf94

Browse files
committedMar 17, 2025·
refactor(oxlint): remove jemallocator (#9823)
jemallocator is inactively maintained. mimalloc is slightly faster on all platforms. This should also improve cold compile time for this project. The only downside of mimalloc is that it requires `cmake`.
1 parent c81b29b commit b34cf94

File tree

4 files changed

+9
-35
lines changed

4 files changed

+9
-35
lines changed
 

‎Cargo.lock

-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ insta = "1.42.1"
189189
itertools = "0.14.0"
190190
itoa = "1.0.14"
191191
javascript-globals = "1.0.0"
192-
jemallocator = "0.5.4"
193192
json-strip-comments = "1.0.4"
194193
language-tags = "0.3.2"
195194
lazy_static = "1.5.0"

‎apps/oxlint/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ path = "src/main.rs"
2424
test = false
2525
doctest = false
2626

27-
[target.'cfg(all(not(target_env = "msvc"), not(target_os = "windows")))'.dependencies]
28-
jemallocator = { workspace = true, optional = true }
29-
30-
[target.'cfg(target_os = "windows")'.dependencies]
31-
mimalloc-safe = { workspace = true, optional = true }
32-
3327
[dependencies]
3428
oxc_diagnostics = { workspace = true }
3529
oxc_linter = { workspace = true }
@@ -46,10 +40,16 @@ serde_json = { workspace = true }
4640
tempfile = { workspace = true }
4741
tracing-subscriber = { workspace = true, features = [] } # Omit the `regex` feature
4842

43+
[target.'cfg(all(not(target_os = "linux"), not(target_os = "freebsd"), not(target_family = "wasm")))'.dependencies]
44+
mimalloc-safe = { workspace = true, optional = true, features = ["skip_collect_on_exit"] }
45+
46+
[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
47+
mimalloc-safe = { workspace = true, optional = true, features = ["skip_collect_on_exit", "local_dynamic_tls"] }
48+
4949
[dev-dependencies]
5050
insta = { workspace = true }
5151
regex = { workspace = true }
5252

5353
[features]
5454
default = []
55-
allocator = ["dep:jemallocator", "dep:mimalloc-safe"]
55+
allocator = ["dep:mimalloc-safe"]

‎apps/oxlint/src/main.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
// NB: Miri does not support custom allocators
2-
#[cfg(all(feature = "allocator", not(miri), not(target_env = "msvc"), not(target_os = "windows")))]
3-
#[global_allocator]
4-
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
5-
6-
#[cfg(all(feature = "allocator", not(miri), target_os = "windows"))]
1+
// NOTE: Miri does not support custom allocators
2+
#[cfg(all(feature = "allocator", not(miri), not(target_family = "wasm")))]
73
#[global_allocator]
84
static GLOBAL: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;
95

0 commit comments

Comments
 (0)
Please sign in to comment.