[][src]Struct swim_mem::alloc::Slab

pub struct Slab<'a> { /* fields omitted */ }

Allocator for a hunk of memory partitioned into fixed size memory blocks.

Methods

impl<'a> Slab<'a>[src]

pub fn new(hunk: Block<'a>, unit: usize) -> Slab<'a>[src]

Returns a new Slab that allocates a hunk of memory in unit-sized blocks.

pub fn size(&self) -> usize[src]

Returns the total number of bytes in this Slab.

pub fn block_size(&self) -> usize[src]

Returns the number of bytes in each memory block of this Slab.

pub fn block_count(&self) -> usize[src]

Returns the total number of blocks in this Slab.

pub fn live(&self) -> usize[src]

Returns the number of currently allocated memory blocks.

pub fn dead(&self) -> usize[src]

Returns the number of memory blocks currently available for allocation.

pub fn into_block(self) -> Block<'a>[src]

Consumes this Slab and returns its hunk of memory.

Trait Implementations

impl<'a> Heap<'a> for Slab<'a>[src]

Auto Trait Implementations

impl<'a> Send for Slab<'a>

impl<'a> Sync for Slab<'a>

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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, U> Into for T where
    U: From<T>, 
[src]

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

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

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