pub struct MemoryUsage {
pub number_allocs: u64,
pub bytes_in_use: u64,
pub bytes_padding: u64,
pub bytes_reserved: u64,
}
Expand description
Amount of memory in use by this allocator and statistics on how much memory is reserved and wasted in total.
Fields§
§number_allocs: u64
The number of allocations currently active.
bytes_in_use: u64
The number of bytes that are currently actually in use.
This doesn’t include any padding or other memory that needs to be reserved, and is the minimum amount of memory that could possible be allocated.
bytes_padding: u64
The amount of bytes used for padding memory in currently active allocations.
bytes_reserved: u64
The total amount of memory reserved on the device.
This will be at least as much as bytes_in_use but in practice will be higher, as allocations reserve memory for future allocations and for padding.
Implementations§
Source§impl MemoryUsage
impl MemoryUsage
Sourcepub fn combine(&self, other: MemoryUsage) -> MemoryUsage
pub fn combine(&self, other: MemoryUsage) -> MemoryUsage
Calculate the combined memory usage of two reports (summing them).
Trait Implementations§
Source§impl Clone for MemoryUsage
impl Clone for MemoryUsage
Source§fn clone(&self) -> MemoryUsage
fn clone(&self) -> MemoryUsage
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 MemoryUsage
impl Debug for MemoryUsage
Source§impl Display for MemoryUsage
impl Display for MemoryUsage
Source§impl PartialEq for MemoryUsage
impl PartialEq for MemoryUsage
impl Eq for MemoryUsage
impl StructuralPartialEq for MemoryUsage
Auto Trait Implementations§
impl Freeze for MemoryUsage
impl RefUnwindSafe for MemoryUsage
impl Send for MemoryUsage
impl Sync for MemoryUsage
impl Unpin for MemoryUsage
impl UnwindSafe for MemoryUsage
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