From fc9c2915c74ac120a9b52c9003f768a9a4e30a55 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Thu, 14 Nov 2019 11:47:18 -0500 Subject: Even if jemalloc feature is used do not use it on msvc Fixes #2233 --- crates/ra_prof/src/lib.rs | 2 +- crates/ra_prof/src/memory_usage.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_prof/src') diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index e5385f51b..845b2221c 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs @@ -24,7 +24,7 @@ pub use crate::memory_usage::{Bytes, MemoryUsage}; // We use jemalloc mainly to get heap usage statistics, actual performance // difference is not measures. -#[cfg(feature = "jemalloc")] +#[cfg(all(feature = "jemalloc", not(target_env = "msvc")))] #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; diff --git a/crates/ra_prof/src/memory_usage.rs b/crates/ra_prof/src/memory_usage.rs index ad005ea14..9768f656c 100644 --- a/crates/ra_prof/src/memory_usage.rs +++ b/crates/ra_prof/src/memory_usage.rs @@ -8,7 +8,7 @@ pub struct MemoryUsage { } impl MemoryUsage { - #[cfg(feature = "jemalloc")] + #[cfg(all(feature = "jemalloc", not(target_env = "msvc")))] pub fn current() -> MemoryUsage { jemalloc_ctl::epoch::advance().unwrap(); MemoryUsage { @@ -17,7 +17,7 @@ impl MemoryUsage { } } - #[cfg(not(feature = "jemalloc"))] + #[cfg(any(not(feature = "jemalloc"), target_env = "msvc"))] pub fn current() -> MemoryUsage { MemoryUsage { allocated: Bytes(0), resident: Bytes(0) } } -- cgit v1.2.3