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]

[src]

Returns a new Allocated.

[src]

Returns the total number of bytes allocated by the application.

Trait Implementations

impl Copy for Allocated
[src]

impl Clone for Allocated
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Allocated

impl Sync for Allocated