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]

Returns a new Tcache.

Returns the thread-local caching behavior.

Auto Trait Implementations

impl Send for Tcache

impl Sync for Tcache