Struct stats_alloc::Stats
source · [−]pub struct Stats {
pub allocations: usize,
pub deallocations: usize,
pub reallocations: usize,
pub bytes_allocated: usize,
pub bytes_deallocated: usize,
pub bytes_reallocated: isize,
}
Expand description
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
sourceimpl SubAssign<Stats> for Stats
impl SubAssign<Stats> for Stats
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation. Read more
impl Copy for Stats
impl Eq for Stats
impl StructuralEq for Stats
impl StructuralPartialEq for Stats
Auto Trait Implementations
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnwindSafe for Stats
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more