[][src]Struct allocator_suite::memory_sources::arena_memory_source::arena_memory_source::ArenaMemorySource

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

An arena memory source.

Methods

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

pub fn new_by_amount(
    memory_source: MS,
    block_size: NonZeroUsize,
    memory_source_size: NonZeroUsize,
    block_initializer: impl Fn(MemoryAddress, 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,
    block_initializer: impl Fn(MemoryAddress, NonZeroUsize)
) -> Result<Self, AllocErr>
[src]

Creates a new instance.

block_size must be at least 8 to be useful. block_initializer takes the address of a block and the size of a block; after it is called, the block will have the first 8 bytes (4 bytes on 32-bit platforms) overwritten with a slot index pointer.

Trait Implementations

impl<MS: MemorySource> MemorySource for ArenaMemorySource<MS>[src]

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

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

Auto Trait Implementations

impl<MS> !Send for ArenaMemorySource<MS>

impl<MS> !Sync for ArenaMemorySource<MS>

impl<MS> Unpin for ArenaMemorySource<MS> where
    MS: Unpin

impl<MS> UnwindSafe for ArenaMemorySource<MS> where
    MS: UnwindSafe

impl<MS> !RefUnwindSafe for ArenaMemorySource<MS>

Blanket Implementations

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

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

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

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