Struct perf_monitor::mem::CountingAllocator [−][src]
pub struct CountingAllocator;
An allocator tracks inuse allocated bytes.
The counter is disable by default. Please enable it by CountingAllocator::enable()
then call CountingAllocator::get_allocated()
will return the bytes inused.
Implementations
impl CountingAllocator
[src]
pub fn get_allocated() -> isize
[src]
Get the inuse bytes allocated by rust.
pub fn is_enable() -> bool
[src]
Check whether the counter is enable.
pub fn reset()
[src]
Reset the counter.
pub fn enable()
[src]
Enable the counter.
pub fn disable()
[src]
Disable the counter.
Trait Implementations
impl GlobalAlloc for CountingAllocator
[src]
Auto Trait Implementations
impl RefUnwindSafe for CountingAllocator
impl Send for CountingAllocator
impl Sync for CountingAllocator
impl Unpin for CountingAllocator
impl UnwindSafe for CountingAllocator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,