pub struct MemoryTracker { /* private fields */ }Expand description
Tracks total GPU memory allocated through this subsystem.
Implementations§
Source§impl MemoryTracker
impl MemoryTracker
Sourcepub fn record_alloc(&self, bytes: usize)
pub fn record_alloc(&self, bytes: usize)
Record an allocation of bytes.
Sourcepub fn record_free(&self, bytes: usize)
pub fn record_free(&self, bytes: usize)
Record a deallocation of bytes.
Sourcepub fn current_bytes(&self) -> u64
pub fn current_bytes(&self) -> u64
Current total allocated bytes.
Sourcepub fn peak_bytes(&self) -> u64
pub fn peak_bytes(&self) -> u64
Peak allocated bytes ever.
Sourcepub fn allocation_count(&self) -> u64
pub fn allocation_count(&self) -> u64
Lifetime allocation count.
Sourcepub fn free_count(&self) -> u64
pub fn free_count(&self) -> u64
Lifetime free count.
Trait Implementations§
Source§impl Debug for MemoryTracker
impl Debug for MemoryTracker
Auto Trait Implementations§
impl !Freeze for MemoryTracker
impl RefUnwindSafe for MemoryTracker
impl Send for MemoryTracker
impl Sync for MemoryTracker
impl Unpin for MemoryTracker
impl UnsafeUnpin for MemoryTracker
impl UnwindSafe for MemoryTracker
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.