[][src]Struct stats_alloc::Stats

pub struct Stats {
    pub allocations: usize,
    pub deallocations: usize,
    pub reallocations: usize,
    pub bytes_allocated: usize,
    pub bytes_deallocated: usize,
    pub bytes_reallocated: isize,
}

Allocator statistics

Fields

allocations: usize

Count of allocation operations

deallocations: usize

Count of deallocation operations

reallocations: usize

Count of reallocation operations

An example where reallocation may occur: resizing of a Vec<T> when its length would excceed its capacity. Excessive reallocations may indicate that resizable data structures are being created with insufficient or poorly estimated initial capcities.

let mut x = Vec::with_capacity(1);
x.push(0);
x.push(1); // Potential reallocation
bytes_allocated: usize

Total bytes requested by allocations

bytes_deallocated: usize

Total bytes freed by deallocations

bytes_reallocated: isize

Total of bytes requested minus bytes freed by reallocations

This number is positive if the total bytes requested by reallocation operations is greater than the total bytes freed by reallocations. A positive value indicates that resizable structures are growing, while a negative value indicates that such structures are shrinking.

Trait Implementations

impl Default for Stats[src]

impl Clone for Stats[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for Stats[src]

impl Copy for Stats[src]

impl PartialEq<Stats> for Stats[src]

impl Debug for Stats[src]

impl Sub<Stats> for Stats[src]

type Output = Stats

The resulting type after applying the - operator.

impl SubAssign<Stats> for Stats[src]

impl Hash for Stats[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Stats

impl Sync for Stats

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]