Struct jemalloc_ctl::stats::Active [−][src]
pub struct Active(_);
A type providing access to the total number of bytes in active pages allocated by the application.
This is a multiple of the page size, and greater than or equal to the value returned by
Allocated.
This statistic is cached, and is only refreshed when the epoch is advanced. See the Epoch
type for more information.
This corresponds to stats.active in jemalloc's API.
Examples
extern crate jemallocator; extern crate jemalloc_ctl; use jemalloc_ctl::Epoch; use jemalloc_ctl::stats::Active; #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; fn main() { let epoch = Epoch::new().unwrap(); let active = Active::new().unwrap(); let a = active.get().unwrap(); let _buf = vec![0; 1024 * 1024]; epoch.advance().unwrap(); let b = active.get().unwrap(); assert!(a < b); }
Methods
impl Active[src]
impl Activepub fn new() -> Result<Active>[src]
pub fn new() -> Result<Active>Returns a new Allocated.
pub fn get(&self) -> Result<usize>[src]
pub fn get(&self) -> Result<usize>Returns the total number of bytes in active pages allocated by the application.