[−][src]Struct allocator_suite::memory_sources::arena_memory_source::arena_memory_source::ArenaMemorySource
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]
memory_source: MS,
block_size: NonZeroUsize,
memory_source_size: NonZeroUsize,
block_initializer: impl Fn(MemoryAddress, NonZeroUsize)
) -> Result<Self, AllocErr>
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]
memory_source: MS,
block_size: NonZeroUsize,
number_of_blocks: NonZeroUsize,
block_initializer: impl Fn(MemoryAddress, NonZeroUsize)
) -> Result<Self, AllocErr>
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]
fn obtain(&self, non_zero_size: NonZeroUsize) -> Result<MemoryAddress, AllocErr>
[src]
fn release(&self, non_zero_size: NonZeroUsize, current_memory: MemoryAddress)
[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,
MS: Unpin,
impl<MS> UnwindSafe for ArenaMemorySource<MS> where
MS: UnwindSafe,
MS: UnwindSafe,
impl<MS> !RefUnwindSafe for ArenaMemorySource<MS>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,