diff options
Diffstat (limited to 'crates/profile/src/memory_usage.rs')
-rw-r--r-- | crates/profile/src/memory_usage.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/profile/src/memory_usage.rs b/crates/profile/src/memory_usage.rs index cb4e54447..2917ded60 100644 --- a/crates/profile/src/memory_usage.rs +++ b/crates/profile/src/memory_usage.rs | |||
@@ -1,4 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Like [`std::time::Instant`], but for memory. |
2 | //! | ||
3 | //! Measures the total size of all currently allocated objects. | ||
2 | use std::fmt; | 4 | use std::fmt; |
3 | 5 | ||
4 | use cfg_if::cfg_if; | 6 | use cfg_if::cfg_if; |
@@ -22,7 +24,7 @@ impl std::ops::Sub for MemoryUsage { | |||
22 | } | 24 | } |
23 | 25 | ||
24 | impl MemoryUsage { | 26 | impl MemoryUsage { |
25 | pub fn current() -> MemoryUsage { | 27 | pub fn now() -> MemoryUsage { |
26 | cfg_if! { | 28 | cfg_if! { |
27 | if #[cfg(all(feature = "jemalloc", not(target_env = "msvc")))] { | 29 | if #[cfg(all(feature = "jemalloc", not(target_env = "msvc")))] { |
28 | jemalloc_ctl::epoch::advance().unwrap(); | 30 | jemalloc_ctl::epoch::advance().unwrap(); |