mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
jemallocator 0.3
This commit is contained in:
parent
c7ceea82a5
commit
5e9198f809
3 changed files with 49 additions and 15 deletions
|
@ -8,10 +8,10 @@ pub struct MemoryUsage {
|
|||
impl MemoryUsage {
|
||||
#[cfg(feature = "jemalloc")]
|
||||
pub fn current() -> MemoryUsage {
|
||||
jemalloc_ctl::epoch().unwrap();
|
||||
jemalloc_ctl::epoch::advance().unwrap();
|
||||
MemoryUsage {
|
||||
allocated: Bytes(jemalloc_ctl::stats::allocated().unwrap()),
|
||||
resident: Bytes(jemalloc_ctl::stats::resident().unwrap()),
|
||||
allocated: Bytes(jemalloc_ctl::stats::allocated::read().unwrap()),
|
||||
resident: Bytes(jemalloc_ctl::stats::resident::read().unwrap()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue