diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-21 17:46:44 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-21 17:46:44 +0000 |
commit | e76d8c1d9af2a78a16d25f348c1d69c331349c1f (patch) | |
tree | 0fddaf6d3c87fce5dac56bd0df655fd58a29c9a8 /crates/profile/src/lib.rs | |
parent | b68d6d6fd58b9f59c9c6202771f1a458a2a14c91 (diff) | |
parent | e5c5c0a040e0c74892ea0a36c7fd50e5410879bd (diff) |
Merge #7378
7378: Include `countme` crate to count important data structures. r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/profile/src/lib.rs')
-rw-r--r-- | crates/profile/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/profile/src/lib.rs b/crates/profile/src/lib.rs index aa6ccc36c..79dba47d5 100644 --- a/crates/profile/src/lib.rs +++ b/crates/profile/src/lib.rs | |||
@@ -15,6 +15,13 @@ pub use crate::{ | |||
15 | stop_watch::{StopWatch, StopWatchSpan}, | 15 | stop_watch::{StopWatch, StopWatchSpan}, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | pub use countme; | ||
19 | /// Include `_c: Count<Self>` field in important structs to count them. | ||
20 | /// | ||
21 | /// To view the counts, run with `RA_COUNT=1`. The overhead of disabled count is | ||
22 | /// almost zero. | ||
23 | pub use countme::Count; | ||
24 | |||
18 | thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false)); | 25 | thread_local!(static IN_SCOPE: RefCell<bool> = RefCell::new(false)); |
19 | 26 | ||
20 | /// Allows to check if the current code is withing some dynamic scope, can be | 27 | /// Allows to check if the current code is withing some dynamic scope, can be |