aboutsummaryrefslogtreecommitdiff
path: root/crates/profile/src/memory_usage.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/profile/src/memory_usage.rs')
-rw-r--r--crates/profile/src/memory_usage.rs6
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.
2use std::fmt; 4use std::fmt;
3 5
4use cfg_if::cfg_if; 6use cfg_if::cfg_if;
@@ -22,7 +24,7 @@ impl std::ops::Sub for MemoryUsage {
22} 24}
23 25
24impl MemoryUsage { 26impl 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();