aboutsummaryrefslogtreecommitdiff
path: root/crates/profile/src/memory_usage.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-22 14:54:13 +0100
committerGitHub <[email protected]>2021-05-22 14:54:13 +0100
commitd56e52402eedbd738b5161cd1e5a8c152cb65e21 (patch)
treec88222888e201b2173cd4a15673bd879cb88dd95 /crates/profile/src/memory_usage.rs
parent542337eca49986d785db2318bfe9c70809d4a229 (diff)
parent188b0f96f98feaa0771f941343887c46113c8ced (diff)
Merge #8922
8922: Add more docs r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
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();