Struct jemalloc_ctl::Epoch[][src]

pub struct Epoch(_);

A type providing access to the jemalloc epoch.

Many of the statistics tracked by jemalloc are cached. The epoch controls when they are refreshed.

Example

Advancing the epoch:

extern crate jemallocator;
extern crate jemalloc_ctl;

use jemalloc_ctl::Epoch;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn main() {
    let epoch = Epoch::new().unwrap();

    let a = epoch.advance().unwrap();
    let b = epoch.advance().unwrap();
    assert_eq!(a + 1, b);
}

Methods

impl Epoch
[src]

Returns a new Epoch.

Advances the epoch, returning it.

The epoch advances by 1 every time it is advanced, so the value can be used to determine if another thread triggered a referesh.

Trait Implementations

impl Copy for Epoch
[src]

impl Clone for Epoch
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Epoch

impl Sync for Epoch