fix(oxlint): gate custom allocators by feature flag (#3945)

This tweaks the conditional compilation of custom allocators by wiring
the dedicated Cargo feature flag `allocator` to the source code. It
ensures that allocator gating is directly checking the relevant feature
instead of trying to infer it from the build profile.
This commit is contained in:
Luca Bruno 2024-06-28 15:34:46 +02:00 committed by GitHub
parent 94329e4c66
commit 750cb43624
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,11 +1,11 @@
#![cfg(not(miri))] // Miri does not support custom allocators
#[cfg(not(debug_assertions))]
#[cfg(feature = "allocator")]
#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
#[cfg(not(debug_assertions))]
#[cfg(feature = "allocator")]
#[cfg(target_os = "windows")]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;