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]
impl BackgroundThread
pub fn new() -> Result<BackgroundThread>
[src]
pub fn new() -> Result<BackgroundThread>
Returns a new BackgroundThread
.
pub fn get(&self) -> Result<bool>
[src]
pub fn get(&self) -> Result<bool>
Returns the current background thread state.
pub fn set(&self, background_thread: bool) -> Result<()>
[src]
pub fn set(&self, background_thread: bool) -> Result<()>
Sets the background thread state.
Trait Implementations
impl Copy for BackgroundThread
[src]
impl Copy for BackgroundThread
impl Clone for BackgroundThread
[src]
impl Clone for BackgroundThread
fn clone(&self) -> BackgroundThread
[src]
fn clone(&self) -> BackgroundThread
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for BackgroundThread
impl Send for BackgroundThread
impl Sync for BackgroundThread
impl Sync for BackgroundThread