Function jemalloc_ctl::stats::allocated [] [src]

pub fn allocated() -> Result<usize>

Returns 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 function for more information.

This corresponds to stats.allocated in jemalloc's API.

Examples

let a = jemalloc_ctl::stats::allocated().unwrap();
let _buf = vec![0; 1024 * 1024];
jemalloc_ctl::epoch().unwrap();
let b = jemalloc_ctl::stats::allocated().unwrap();
assert!(a < b);