Struct allocators::freelist::FreeList [] [src]

pub struct FreeList<'a, A: 'a + Allocator> {
    // some fields omitted
}

A FreeList allocator manages a list of free memory blocks of uniform size. Whenever a block is requested, it returns the first free block.

Methods

impl FreeList<'static, HeapAllocator>

fn new(block_size: usize, num_blocks: usize) -> Result<Self, Error>

Creates a new FreeList backed by the heap. block_size must be greater than or equal to the size of a pointer.

impl<'a, A: 'a + Allocator> FreeList<'a, A>

fn new_from(alloc: &'a A, block_size: usize, num_blocks: usize) -> Result<Self, Error>

Creates a new FreeList backed by another allocator. block_size must be greater than or equal to the size of a pointer.

Trait Implementations

impl<'a, A: 'a + Allocator> Allocator for FreeList<'a, A>

unsafe fn allocate_raw(&self, size: usize, align: usize) -> Result<Block, Error>

unsafe fn reallocate_raw<'b>(&'b self, block: Block<'b>, new_size: usize) -> Result<Block<'b>, (Error, Block<'b>)>

unsafe fn deallocate_raw(&self, block: Block)

fn allocate<T>(&self, val: T) -> Result<AllocBox<T, Self>, (Error, T)> where Self: Sized

fn make_place<T>(&self) -> Result<Place<T, Self>, Error> where Self: Sized

impl<'a, A: 'a + Allocator> Drop for FreeList<'a, A>

fn drop(&mut self)

impl<'a, A: 'a + Allocator + Sync> Send for FreeList<'a, A>