Struct allocation_counter::AllocationInfo
source · pub struct AllocationInfo {
pub count_total: u64,
pub count_current: i64,
pub count_max: u64,
pub bytes_total: u64,
pub bytes_current: i64,
pub bytes_max: u64,
}
Expand description
The allocation information obtained by a measure() call.
Fields§
§count_total: u64
The total number of allocations made during a measure() call.
count_current: i64
The current (net result) number of allocations during a measure() call.
A non-zero value of this field means that the function did not deallocate all allocations, as shown below.
let info = allocation_counter::measure(|| {
let b = std::hint::black_box(Box::new(1_u32));
std::mem::forget(b);
});
assert_eq!(info.count_current, 1);
count_max: u64
The max number of allocations held during a point in time during a measure() call.
bytes_total: u64
The total amount of bytes allocated during a measure() call.
bytes_current: i64
The current (net result) amount of bytes allocated during a measure() call.
A non-zero value of this field means that not all memory was deallocated, as shown below.
let info = allocation_counter::measure(|| {
let b = std::hint::black_box(Box::new(1_u32));
std::mem::forget(b);
});
assert_eq!(info.bytes_current, 4);
bytes_max: u64
The max amount of bytes allocated at one time during a measure() call.
Trait Implementations§
source§impl AddAssign<AllocationInfo> for AllocationInfo
impl AddAssign<AllocationInfo> for AllocationInfo
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl Clone for AllocationInfo
impl Clone for AllocationInfo
source§fn clone(&self) -> AllocationInfo
fn clone(&self) -> AllocationInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AllocationInfo
impl Debug for AllocationInfo
source§impl Default for AllocationInfo
impl Default for AllocationInfo
source§fn default() -> AllocationInfo
fn default() -> AllocationInfo
Returns the “default value” for a type. Read more
source§impl Hash for AllocationInfo
impl Hash for AllocationInfo
source§impl PartialEq<AllocationInfo> for AllocationInfo
impl PartialEq<AllocationInfo> for AllocationInfo
source§fn eq(&self, other: &AllocationInfo) -> bool
fn eq(&self, other: &AllocationInfo) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for AllocationInfo
impl Eq for AllocationInfo
impl StructuralEq for AllocationInfo
impl StructuralPartialEq for AllocationInfo
Auto Trait Implementations§
impl RefUnwindSafe for AllocationInfo
impl Send for AllocationInfo
impl Sync for AllocationInfo
impl Unpin for AllocationInfo
impl UnwindSafe for AllocationInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more