pub trait BumpAllocatorArena {
// Required methods
fn start(&self) -> *const u8;
fn size(&self) -> usize;
fn ensure_min_size(
&self,
min_size: usize,
) -> BumpAllocatorArenaResult<usize>;
// Provided method
fn past_end(&self, ptr: *const u8) -> Option<usize> { ... }
}Expand description
Trait to model a consecutive chunk of linear memory for bump allocators.
Required Methods§
Sourcefn ensure_min_size(&self, min_size: usize) -> BumpAllocatorArenaResult<usize>
fn ensure_min_size(&self, min_size: usize) -> BumpAllocatorArenaResult<usize>
Ensures that the arena is at least min_size bytes big, or returns an error if that is not possible.