diff options
author | Seivan Heidari <[email protected]> | 2019-11-14 22:20:27 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-14 22:20:27 +0000 |
commit | c622413bc72ea56d5f62a16788d897cb61eca948 (patch) | |
tree | 9de3dbe8b5c935ed168efac4e70770e54fbe0714 /crates/ra_prof/src | |
parent | 0525778a3ad590492b51cc11085d815f9bb8f92b (diff) | |
parent | bbb022d3999b3038549ec6c309efb065231c896a (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_prof/src')
-rw-r--r-- | crates/ra_prof/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_prof/src/memory_usage.rs | 4 |
2 files changed, 3 insertions, 3 deletions
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}; | |||
24 | 24 | ||
25 | // We use jemalloc mainly to get heap usage statistics, actual performance | 25 | // We use jemalloc mainly to get heap usage statistics, actual performance |
26 | // difference is not measures. | 26 | // difference is not measures. |
27 | #[cfg(feature = "jemalloc")] | 27 | #[cfg(all(feature = "jemalloc", not(target_env = "msvc")))] |
28 | #[global_allocator] | 28 | #[global_allocator] |
29 | static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; | 29 | static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; |
30 | 30 | ||
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 { | |||
8 | } | 8 | } |
9 | 9 | ||
10 | impl MemoryUsage { | 10 | impl MemoryUsage { |
11 | #[cfg(feature = "jemalloc")] | 11 | #[cfg(all(feature = "jemalloc", not(target_env = "msvc")))] |
12 | pub fn current() -> MemoryUsage { | 12 | pub fn current() -> MemoryUsage { |
13 | jemalloc_ctl::epoch::advance().unwrap(); | 13 | jemalloc_ctl::epoch::advance().unwrap(); |
14 | MemoryUsage { | 14 | MemoryUsage { |
@@ -17,7 +17,7 @@ impl MemoryUsage { | |||
17 | } | 17 | } |
18 | } | 18 | } |
19 | 19 | ||
20 | #[cfg(not(feature = "jemalloc"))] | 20 | #[cfg(any(not(feature = "jemalloc"), target_env = "msvc"))] |
21 | pub fn current() -> MemoryUsage { | 21 | pub fn current() -> MemoryUsage { |
22 | MemoryUsage { allocated: Bytes(0), resident: Bytes(0) } | 22 | MemoryUsage { allocated: Bytes(0), resident: Bytes(0) } |
23 | } | 23 | } |