[][src]Struct interloc::InterAlloc

pub struct InterAlloc<'a, T, F> where
    T: GlobalAlloc,
    F: AllocMonitor
{ pub inner: T, pub monitor: &'a F, }

An allocator that watches the calls to its API, sends them to a struct, and then makes the calls.

To use this struct, use the #[global_allocator] compiler directive and construct the allocator with your own custom monitor, or one of the builtins. Note that the new method of interloc::StatsMonitor is a const fn.

Fields

inner: T

Inner allocator

monitor: &'a F

Monitor on the calls to the allocator

Methods

impl<'a, T, F> InterAlloc<'a, T, F> where
    T: GlobalAlloc,
    F: AllocMonitor
[src]

pub fn new(base: T, monitor: &'a F) -> Self[src]

A new instance of the allocator.

Trait Implementations

impl<'a, T, F> GlobalAlloc for InterAlloc<'a, T, F> where
    T: GlobalAlloc,
    F: AllocMonitor
[src]

Auto Trait Implementations

impl<'a, T, F> Send for InterAlloc<'a, T, F> where
    F: Sync,
    T: Send

impl<'a, T, F> Sync for InterAlloc<'a, T, F> where
    F: Sync,
    T: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]