Skip to main content

ArenaExt

Trait ArenaExt 

Source
pub trait ArenaExt: Allocator {
    // Required method
    unsafe fn alloc_zeroed(&self, layout: Layout) -> Option<NonNull<u8>>;
}
Expand description

Extension trait that adds zeroed allocation to arena-like allocators.

Required Methods§

Source

unsafe fn alloc_zeroed(&self, layout: Layout) -> Option<NonNull<u8>>

Allocates a block of memory and fills it with zeroes before returning.

§Safety
  • layout.size() must be greater than zero.
  • Same lifetime and invalidation rules as the underlying alloc apply.

Implementors§