aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_prof/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_prof/src')
-rw-r--r--crates/ra_prof/src/memory_usage.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_prof/src/memory_usage.rs b/crates/ra_prof/src/memory_usage.rs
index 745345fac..857b51321 100644
--- a/crates/ra_prof/src/memory_usage.rs
+++ b/crates/ra_prof/src/memory_usage.rs
@@ -5,7 +5,6 @@ use cfg_if::cfg_if;
5 5
6pub struct MemoryUsage { 6pub struct MemoryUsage {
7 pub allocated: Bytes, 7 pub allocated: Bytes,
8 pub resident: Bytes,
9} 8}
10 9
11impl MemoryUsage { 10impl MemoryUsage {
@@ -14,9 +13,9 @@ impl MemoryUsage {
14 if #[cfg(target_os = "linux")] { 13 if #[cfg(target_os = "linux")] {
15 // Note: This is incredibly slow. 14 // Note: This is incredibly slow.
16 let alloc = unsafe { libc::mallinfo() }.uordblks as u32 as usize; 15 let alloc = unsafe { libc::mallinfo() }.uordblks as u32 as usize;
17 MemoryUsage { allocated: Bytes(alloc), resident: Bytes(0) } 16 MemoryUsage { allocated: Bytes(alloc) }
18 } else { 17 } else {
19 MemoryUsage { allocated: Bytes(0), resident: Bytes(0) } 18 MemoryUsage { allocated: Bytes(0) }
20 } 19 }
21 } 20 }
22 } 21 }
@@ -24,7 +23,7 @@ impl MemoryUsage {
24 23
25impl fmt::Display for MemoryUsage { 24impl fmt::Display for MemoryUsage {
26 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { 25 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
27 write!(fmt, "{} allocated {} resident", self.allocated, self.resident,) 26 write!(fmt, "{}", self.allocated)
28 } 27 }
29} 28}
30 29