[][src]Struct context_allocator::allocators::bit_set::BitSetAllocator

pub struct BitSetAllocator<MS: MemorySource> { /* fields omitted */ }

Bit set based allocator.

Methods

impl<MS: MemorySource> BitSetAllocator<MS>[src]

pub fn new_by_amount_8(
    memory_source: MS,
    memory_source_size: NonZeroUsize
) -> Result<Self, AllocErr>
[src]

New instance wrapping a block of memory for an 8 byte block size.

pub fn new_by_amount_16(
    memory_source: MS,
    memory_source_size: NonZeroUsize
) -> Result<Self, AllocErr>
[src]

New instance wrapping a block of memory for a 16 byte block size.

pub fn new_by_amount_32(
    memory_source: MS,
    memory_source_size: NonZeroUsize
) -> Result<Self, AllocErr>
[src]

New instance wrapping a block of memory for a 32 byte block size.

pub fn new_by_amount(
    memory_source: MS,
    block_size: NonZeroUsize,
    memory_source_size: NonZeroUsize
) -> Result<Self, AllocErr>
[src]

Create a new instance by memory size and block size.

pub fn new(
    memory_source: MS,
    block_size: NonZeroUsize,
    number_of_blocks: NonZeroUsize
) -> Result<Self, AllocErr>
[src]

Create a new instance.

Trait Implementations

impl<MS: MemorySource> LocalAllocator for BitSetAllocator<MS>[src]

fn contains(&self, from_memory_address: MemoryAddress) -> bool[src]

Returns true if this allocator is responsible for an allocation starting with the given from_memory_address. Read more

impl<MS: MemorySource> Allocator for BitSetAllocator<MS>[src]

const ZeroSizedAllocation: MemoryAddress[src]

The sentinel value used for a zero-sized allocation.

fn adapt<'a>(&'a self) -> AllocatorAdaptor<'a, Self>[src]

Adapts to a GlobalAlloc and Alloc.

fn adapt_reference<'a>(&'a self) -> &'a AllocatorAdaptor<'a, Self>[src]

Adapts a reference to a GlobalAlloc and Alloc reference.

impl<MS: MemorySource> Drop for BitSetAllocator<MS>[src]

impl<MS: Debug + MemorySource> Debug for BitSetAllocator<MS>[src]

Auto Trait Implementations

impl<MS> !Send for BitSetAllocator<MS>

impl<MS> !Sync for BitSetAllocator<MS>

Blanket Implementations

impl<T> From for T[src]

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

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

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

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.