[][src]Struct basic_allocator::allocators::GenericAllocator

pub struct GenericAllocator<G> { /* fields omitted */ }

A thread-safe allocator, using a spin lock around a RawAlloc.

Thread-safety is required for an allocator to be used as a global allocator, so that was easy to add with a spin lock.

Implementations

impl<G> GenericAllocator<G>[src]

pub const fn new() -> Self[src]

impl<G: HeapGrower + Default> GenericAllocator<G>[src]

pub unsafe fn get_raw(&self) -> MutexGuard<RawAlloc<G>>[src]

Get a reference to the underlying RawAlloc.

Safety

This is unsafe because it blocks allocation while the mutex guard is in place.

pub fn stats(&self) -> (Validity, Stats)[src]

Trait Implementations

impl<G: HeapGrower + Default> Default for GenericAllocator<G>[src]

Auto Trait Implementations

impl<G> Send for GenericAllocator<G> where
    G: Send

impl<G> Sync for GenericAllocator<G> where
    G: Send

impl<G> Unpin for GenericAllocator<G> where
    G: Unpin

Blanket Implementations

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

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

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

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.