From 110bad6ac0a341c0b097dbc4d33d9b8da489d50d Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Sat, 21 Nov 2026 02:10:36 +0000 Subject: [PATCH] fix(alloc): Restore not(target_env = "msvc") cfg gates and gate default module --- src/core/alloc/mod.rs | 15 +++++++++------ src/core/config/check.rs | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/alloc/mod.rs b/src/core/alloc/mod.rs index f137771e7..16b7bfe5e 100644 --- a/src/core/alloc/mod.rs +++ b/src/core/alloc/mod.rs @@ -1,14 +1,17 @@ //! Integration with allocators -pub mod default; - -#[cfg(feature = "jemalloc")] +// jemalloc +#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))] pub mod je; -#[cfg(feature = "jemalloc")] +#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))] pub use je::{memory_stats, memory_usage, memory_usage_stats, trim}; -#[cfg(all(feature = "mimalloc", not(feature = "jemalloc")))] +// mimalloc +#[cfg(all(feature = "mimalloc", any(target_env = "msvc", not(feature = "jemalloc"))))] pub mod mimalloc; -#[cfg(not(feature = "jemalloc"))] +// default +#[cfg(any(target_env = "msvc", not(feature = "jemalloc")))] +pub mod default; +#[cfg(any(target_env = "msvc", not(feature = "jemalloc")))] pub use default::{memory_stats, memory_usage, memory_usage_stats, trim}; diff --git a/src/core/config/check.rs b/src/core/config/check.rs index e7aa6649b..2c6f98912 100644 --- a/src/core/config/check.rs +++ b/src/core/config/check.rs @@ -43,7 +43,7 @@ pub fn check(config: &Config) -> Result { )); } - if cfg!(all(feature = "mimalloc", feature = "jemalloc")) { + if cfg!(all(feature = "mimalloc", feature = "jemalloc", not(target_env = "msvc"))) { debug_warn!( "mimalloc and jemalloc compile-time features are both enabled, this causes jemalloc \ to be used."