pub struct Usage {
pub total: usize,
pub used: usize,
pub free: usize,
pub objects: usize,
}Expand description
Memory usage information.
This structure is returned by Teaspoon::usage. See that method
documentation for information and examples.
Fields§
§total: usizeTotal memory available to the allocator.
This includes memory that may be used by the allocator for both allocated objects and
internal structures. total usually matches the size passed to the
Teaspoon constructor, but sometimes may be slightly lower due to align
requirements.
Note that total does not equal used + free. That’s because used does not keep into
account the overhead from the internal structures used by the allocator. The expression
total - used - free may be used to calculate this overhead.
used: usizeTotal memory used by allocated objects.
This is the sum of the usable data of each allocated object. It does not take into account the overhead from the internal structures used by the allocator.
free: usizeMemory unused by the allocator.
This is the total memory available, minus all the allocated memory, minus all the memory
used by internal structures. Note that trying to allocate an object of size equal to (or
close to) free may not succeed, due to overheads and memory fragmentation.
objects: usizeNumber of objects currently allocated.
Allocating an object increments this number; deallocating an object decrements it; growing/shrinking an object does not alter this number.
Trait Implementations§
impl Eq for Usage
impl StructuralPartialEq for Usage
Auto Trait Implementations§
impl Freeze for Usage
impl RefUnwindSafe for Usage
impl Send for Usage
impl Sync for Usage
impl Unpin for Usage
impl UnwindSafe for Usage
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)