diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 09:43:47 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 09:43:47 +0100 |
commit | f22af66c3763c4b2a9d16621473cb6979fb2f36d (patch) | |
tree | 4b35f683a6bfb70fa9e1db3b22371ebcde0e7d99 /crates | |
parent | 5e498546e8275c86e0b3f711b069b2787c6385f2 (diff) |
Fixes
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_prof/src/stop_watch.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_prof/src/stop_watch.rs b/crates/ra_prof/src/stop_watch.rs index c52c92ce5..8b8ec25a5 100644 --- a/crates/ra_prof/src/stop_watch.rs +++ b/crates/ra_prof/src/stop_watch.rs | |||
@@ -1,3 +1,4 @@ | |||
1 | //! Like `std::time::Instant`, but also measures memory & CPU cycles. | ||
1 | use std::{ | 2 | use std::{ |
2 | fmt, | 3 | fmt, |
3 | time::{Duration, Instant}, | 4 | time::{Duration, Instant}, |
@@ -76,14 +77,3 @@ impl fmt::Display for StopWatchSpan { | |||
76 | Ok(()) | 77 | Ok(()) |
77 | } | 78 | } |
78 | } | 79 | } |
79 | |||
80 | // Unclear if we need this: | ||
81 | // https://github.com/jimblandy/perf-event/issues/8 | ||
82 | impl Drop for StopWatch { | ||
83 | fn drop(&mut self) { | ||
84 | #[cfg(target_os = "linux")] | ||
85 | if let Some(mut counter) = self.counter.take() { | ||
86 | let _ = counter.disable(); | ||
87 | } | ||
88 | } | ||
89 | } | ||