Struct jemalloc_ctl::thread::Deallocated
[−]
[src]
pub struct Deallocated(_);
A type providing access to the total number of bytes deallocated by the current thread.
The get method doesn't return the value directly, but actually a pointer to the value. This
allows for very fast repeated lookup, since there is no function call overhead. The pointer type
cannot be sent to other threads, but Deallocated::get can be called on different threads and
will return the appropriate pointer for each of them.
Example
use jemalloc_ctl::thread::Deallocated; let deallocated = Deallocated::new().unwrap(); let deallocated = deallocated.get().unwrap(); let a = deallocated.get(); let buf = vec![0; 1024 * 1024]; let b = deallocated.get(); drop(buf); let c = deallocated.get(); assert_eq!(a, b); assert!(b < c);
Methods
impl Deallocated[src]
fn new() -> Result<Deallocated>[src]
Returns a new Deallocated.
fn get(&self) -> Result<ThreadLocal<u64>>[src]
Returns a thread-local pointer to the total number of bytes deallocated by this thread.
Trait Implementations
impl Copy for Deallocated[src]
impl Clone for Deallocated[src]
fn clone(&self) -> Deallocated[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more