diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-22 14:54:13 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-22 14:54:13 +0100 |
commit | d56e52402eedbd738b5161cd1e5a8c152cb65e21 (patch) | |
tree | c88222888e201b2173cd4a15673bd879cb88dd95 /crates/profile/src/memory_usage.rs | |
parent | 542337eca49986d785db2318bfe9c70809d4a229 (diff) | |
parent | 188b0f96f98feaa0771f941343887c46113c8ced (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.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(); |