Struct jemalloc_ctl::opt::Tcache [−][src]
pub struct Tcache(_);
A type providing access to thread-local allocation caching behavior.
Thread-specific caching allows many allocations to be satisfied without performing any thread synchronization, at the cost of increased memory use. This is enabled by default.
Examples
extern crate jemallocator; extern crate jemalloc_ctl; use jemalloc_ctl::opt::Tcache; #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; fn main() { let tcache = Tcache::new().unwrap(); println!("thread-local caching: {}", tcache.get().unwrap()); }
Methods
impl Tcache[src]
impl Tcachepub fn new() -> Result<Tcache>[src]
pub fn new() -> Result<Tcache>Returns a new Tcache.
pub fn get(&self) -> Result<bool>[src]
pub fn get(&self) -> Result<bool>Returns the thread-local caching behavior.