From d786e7205afe076671f45264920433571b8f97df Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Thu, 27 Jun 2024 18:45:17 +0200 Subject: [PATCH] fix(oxlint): gate custom allocators by feature flag 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. --- apps/oxlint/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/oxlint/src/main.rs b/apps/oxlint/src/main.rs index 70599e10d888b..6f531554b5fa1 100644 --- a/apps/oxlint/src/main.rs +++ b/apps/oxlint/src/main.rs @@ -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;