MutBumpAllocator

Trait MutBumpAllocator 

Source
pub unsafe trait MutBumpAllocator: BumpAllocator { }
Expand description

A marker trait for BumpAllocators who have exclusive access to allocation.

§Safety

Implementors must have exclusive access to to the bump allocator.

Trait Implementations§

Source§

impl BumpAllocatorExt for dyn MutBumpAllocator + '_

Source§

type Stats<'b> = AnyStats<'b> where Self: 'b

The type returned by the stats method.
Source§

fn stats(&self) -> AnyStats<'_>

Returns a type which provides statistics about the memory usage of the bump allocator.
Source§

fn allocate_layout(&self, layout: Layout) -> NonNull<u8>

A specialized version of allocate. Read more
Source§

fn try_allocate_layout(&self, layout: Layout) -> Result<NonNull<u8>, AllocError>

A specialized version of allocate. Read more
Source§

fn allocate_sized<T>(&self) -> NonNull<T>

A specialized version of allocate. Read more
Source§

fn try_allocate_sized<T>(&self) -> Result<NonNull<T>, AllocError>

A specialized version of allocate. Read more
Source§

fn allocate_slice<T>(&self, len: usize) -> NonNull<T>

A specialized version of allocate. Read more
Source§

fn try_allocate_slice<T>(&self, len: usize) -> Result<NonNull<T>, AllocError>

A specialized version of allocate. Read more
Source§

unsafe fn shrink_slice<T>( &self, ptr: NonNull<T>, old_len: usize, new_len: usize, ) -> Option<NonNull<T>>

A specialized version of shrink. Read more
Source§

fn prepare_slice_allocation<T>(&self, len: usize) -> NonNull<[T]>

A specialized version of prepare_allocation. Read more
Source§

fn try_prepare_slice_allocation<T>( &self, len: usize, ) -> Result<NonNull<[T]>, AllocError>

A specialized version of prepare_allocation. Read more
Source§

unsafe fn allocate_prepared_slice<T>( &self, ptr: NonNull<T>, len: usize, cap: usize, ) -> NonNull<[T]>

A specialized version of allocate_prepared. Read more
Source§

unsafe fn allocate_prepared_slice_rev<T>( &self, ptr: NonNull<T>, len: usize, cap: usize, ) -> NonNull<[T]>

A specialized version of allocate_prepared_rev. Read more

Implementations on Foreign Types§

Source§

impl<A: MutBumpAllocator + ?Sized> MutBumpAllocator for &mut A

Implementors§

Source§

impl<A, const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const DEALLOCATES: bool> MutBumpAllocator for Bump<A, MIN_ALIGN, UP, GUARANTEED_ALLOCATED, DEALLOCATES>
where MinimumAlignment<MIN_ALIGN>: SupportedMinimumAlignment, A: BaseAllocator<GUARANTEED_ALLOCATED>,

Source§

impl<A, const MIN_ALIGN: usize, const UP: bool, const GUARANTEED_ALLOCATED: bool, const DEALLOCATES: bool> MutBumpAllocator for BumpScope<'_, A, MIN_ALIGN, UP, GUARANTEED_ALLOCATED, DEALLOCATES>
where MinimumAlignment<MIN_ALIGN>: SupportedMinimumAlignment, A: BaseAllocator<GUARANTEED_ALLOCATED>,

Source§

impl<A: MutBumpAllocator> MutBumpAllocator for WithoutDealloc<A>

Source§

impl<A: MutBumpAllocator> MutBumpAllocator for WithoutShrink<A>