Skip to content

Commit 174375d

Browse files
fix(oxfmt,oxlint): disable mimalloc for 32-bit Arm targets (#17473)
This makes the condition for enabling mimalloc the same across the entire codebase. The condition for enabling mimalloc dependency was the same across all the projects, but wasn't the same when actually enabling it. ~Not sure if removing the miri condition is fine. But if we are rewriting this, let's just do this as well and test it on CI~ (miri condition added back after maintainer request)
1 parent 435e955 commit 174375d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

apps/oxfmt/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ pub mod stdin;
99
#[cfg(feature = "napi")]
1010
pub use main_napi::*;
1111

12-
#[cfg(all(feature = "allocator", not(miri), not(target_family = "wasm")))]
12+
#[cfg(all(
13+
feature = "allocator",
14+
not(any(target_arch = "arm", miri, target_os = "freebsd", target_family = "wasm"))
15+
))]
1316
#[global_allocator]
1417
static GLOBAL: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

apps/oxlint/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ mod js_plugins;
3838
// Use Mimalloc as the global allocator if `--features allocator` is enabled.
3939
// Mimalloc has better performance, but this is feature-gated because it's slow to compile.
4040
// `--features allocator` is only used in release builds.
41-
#[cfg(all(feature = "allocator", not(miri), not(target_family = "wasm")))]
41+
#[cfg(all(
42+
feature = "allocator",
43+
not(any(target_arch = "arm", miri, target_os = "freebsd", target_family = "wasm"))
44+
))]
4245
#[global_allocator]
4346
static GLOBAL: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

0 commit comments

Comments
 (0)