opt-in jemalloc
This commit is contained in:
@@ -133,6 +133,7 @@ struct MemoryStats {
|
||||
}
|
||||
|
||||
impl MemoryStats {
|
||||
#[cfg(feature = "jemalloc")]
|
||||
fn current() -> MemoryStats {
|
||||
jemalloc_ctl::epoch().unwrap();
|
||||
MemoryStats {
|
||||
@@ -140,6 +141,14 @@ impl MemoryStats {
|
||||
resident: Bytes(jemalloc_ctl::stats::resident().unwrap()),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "jemalloc"))]
|
||||
fn current() -> MemoryStats {
|
||||
MemoryStats {
|
||||
allocated: Bytes(0),
|
||||
resident: Bytes(0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for MemoryStats {
|
||||
|
||||
Reference in New Issue
Block a user