aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/status.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-28 12:52:45 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-28 12:52:45 +0000
commitebb19bb95c79671d5ef1e21a8fcb4daafc356490 (patch)
treedaa75c52c641577945c44b0d4f9838772341988f /crates/ra_ide_api/src/status.rs
parent3432c4366f578b4f0a9a6e0384292d72e43ebf03 (diff)
parent2ee08098a6315aaab07f14c67db024ee0e95af3e (diff)
Merge #697
697: opt-in jemalloc r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/status.rs')
-rw-r--r--crates/ra_ide_api/src/status.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs
index c3e5745d5..bd355dd78 100644
--- a/crates/ra_ide_api/src/status.rs
+++ b/crates/ra_ide_api/src/status.rs
@@ -133,6 +133,7 @@ struct MemoryStats {
133} 133}
134 134
135impl MemoryStats { 135impl MemoryStats {
136 #[cfg(feature = "jemalloc")]
136 fn current() -> MemoryStats { 137 fn current() -> MemoryStats {
137 jemalloc_ctl::epoch().unwrap(); 138 jemalloc_ctl::epoch().unwrap();
138 MemoryStats { 139 MemoryStats {
@@ -140,6 +141,14 @@ impl MemoryStats {
140 resident: Bytes(jemalloc_ctl::stats::resident().unwrap()), 141 resident: Bytes(jemalloc_ctl::stats::resident().unwrap()),
141 } 142 }
142 } 143 }
144
145 #[cfg(not(feature = "jemalloc"))]
146 fn current() -> MemoryStats {
147 MemoryStats {
148 allocated: Bytes(0),
149 resident: Bytes(0),
150 }
151 }
143} 152}
144 153
145impl fmt::Display for MemoryStats { 154impl fmt::Display for MemoryStats {