Skip to content

Commit

Permalink
fix(linter): fix oxlint allocator cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jul 29, 2024
1 parent 58c8612 commit d497007
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/oxlint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ path = "src/main.rs"
test = false
doctest = false

[target.'cfg(not(target_env = "msvc"))'.dependencies]
[target.'cfg(all(not(target_env = "msvc"), not(target_os = "windows")))'.dependencies]
jemallocator = { workspace = true, optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
Expand Down
9 changes: 3 additions & 6 deletions apps/oxlint/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#![cfg(not(miri))] // Miri does not support custom allocators

#[cfg(feature = "allocator")]
#[cfg(not(target_env = "msvc"))]
// NB: Miri does not support custom allocators
#[cfg(all(feature = "allocator", not(miri), not(target_env = "msvc"), not(target_os = "windows")))]
#[global_allocator]
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[cfg(feature = "allocator")]
#[cfg(target_os = "windows")]
#[cfg(all(feature = "allocator", not(miri), target_os = "windows"))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

Expand Down

0 comments on commit d497007

Please sign in to comment.