Struct jemalloc_ctl::BackgroundThread[][src]

pub struct BackgroundThread(_);

A type providing access to the state of internal background worker threads.

When enabled, background threads are created on demand (the number of background threads will be no more than the number of CPUs or active arenas). Threads run periodically and handle purging asynchronously.

extern crate jemallocator;
extern crate jemalloc_ctl;

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

fn main() {
    let mut background_thread = jemalloc_ctl::BackgroundThread::new().unwrap();
    background_thread.set(true).unwrap();
    assert!(background_thread.get().unwrap());
}

Methods

impl BackgroundThread
[src]

Returns a new BackgroundThread.

Returns the current background thread state.

Sets the background thread state.

Trait Implementations

impl Copy for BackgroundThread
[src]

impl Clone for BackgroundThread
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations