Struct jemalloc_ctl::stats::Allocated
[−]
[src]
pub struct Allocated(_);
A type providing access to the total number of bytes allocated by the application.
This statistic is cached, and is only refreshed when the epoch is advanced. See the Epoch
type for more information.
This corresponds to stats.allocated in jemalloc's API.
Examples
use jemalloc_ctl::Epoch; use jemalloc_ctl::stats::Allocated; let epoch = Epoch::new().unwrap(); let allocated = Allocated::new().unwrap(); let a = allocated.get().unwrap(); let _buf = vec![0; 1024 * 1024]; epoch.advance().unwrap(); let b = allocated.get().unwrap(); assert!(a < b);
Methods
impl Allocated[src]
fn new() -> Result<Allocated>[src]
Returns a new Allocated.
fn get(&self) -> Result<usize>[src]
Returns the total number of bytes allocated by the application.