Measure heap usage while processing the ledger
This commit is contained in:
@ -28,6 +28,7 @@ impl Allocatedp {
|
||||
Self {}
|
||||
}
|
||||
|
||||
/// Return current thread heap usage
|
||||
pub fn get(&self) -> u64 {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
@ -36,4 +37,9 @@ impl Allocatedp {
|
||||
#[cfg(not(unix))]
|
||||
0
|
||||
}
|
||||
|
||||
/// Return the difference in thread heap usage since a previous `get()`
|
||||
pub fn since(&self, previous: u64) -> i64 {
|
||||
self.get() as i64 - previous as i64
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user