File tree Expand file tree Collapse file tree 3 files changed +22
-20
lines changed Expand file tree Collapse file tree 3 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 1
- [package ]
2
- edition = " 2018"
3
- name = " ra_prof"
4
- version = " 0.1.0"
5
- authors = [" rust-analyzer developers" ]
6
- publish = false
7
-
8
- [dependencies ]
9
- once_cell = " 1.0.1"
10
- itertools = " 0.8.0"
11
- backtrace = " 0.3.28"
12
- jemallocator = { version = " 0.3.2" , optional = true }
13
- jemalloc-ctl = { version = " 0.3.2" , optional = true }
14
-
15
- [features ]
16
- jemalloc = [ " jemallocator" , " jemalloc-ctl" ]
17
- cpu_profiler = []
1
+ [package ]
2
+ edition = " 2018"
3
+ name = " ra_prof"
4
+ version = " 0.1.0"
5
+ authors = [" rust-analyzer developers" ]
6
+ publish = false
7
+
8
+ [dependencies ]
9
+ once_cell = " 1.0.1"
10
+ itertools = " 0.8.0"
11
+ backtrace = " 0.3.28"
12
+
13
+ [target .'cfg(not(target_env = "msvc"))' .dependencies ]
14
+ jemallocator = { version = " 0.3.2" , optional = true }
15
+ jemalloc-ctl = { version = " 0.3.2" , optional = true }
16
+
17
+ [features ]
18
+ jemalloc = [ " jemallocator" , " jemalloc-ctl" ]
19
+ cpu_profiler = []
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub use crate::memory_usage::{Bytes, MemoryUsage};
24
24
25
25
// We use jemalloc mainly to get heap usage statistics, actual performance
26
26
// difference is not measures.
27
- #[ cfg( feature = "jemalloc" ) ]
27
+ #[ cfg( all ( feature = "jemalloc" , not ( target_env = "msvc" ) ) ) ]
28
28
#[ global_allocator]
29
29
static ALLOC : jemallocator:: Jemalloc = jemallocator:: Jemalloc ;
30
30
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ pub struct MemoryUsage {
8
8
}
9
9
10
10
impl MemoryUsage {
11
- #[ cfg( feature = "jemalloc" ) ]
11
+ #[ cfg( all ( feature = "jemalloc" , not ( target_env = "msvc" ) ) ) ]
12
12
pub fn current ( ) -> MemoryUsage {
13
13
jemalloc_ctl:: epoch:: advance ( ) . unwrap ( ) ;
14
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
21
pub fn current ( ) -> MemoryUsage {
22
22
MemoryUsage { allocated : Bytes ( 0 ) , resident : Bytes ( 0 ) }
23
23
}
You can’t perform that action at this time.
0 commit comments