Struct cranelift_egraph::BumpArena
source · pub struct BumpArena<T> { /* private fields */ }
Implementations§
source§impl<T> BumpArena<T>
impl<T> BumpArena<T>
sourcepub fn arena_with_capacity(cap: usize) -> Self
pub fn arena_with_capacity(cap: usize) -> Self
Create a new arena, pre-allocating space for cap
total T
elements.
sourcepub fn vec_with_capacity(&mut self, cap: usize) -> BumpVec<T>
pub fn vec_with_capacity(&mut self, cap: usize) -> BumpVec<T>
Create a new BumpVec
with the given pre-allocated capacity
and zero length.
sourcepub fn single(&mut self, t: T) -> BumpVec<T>
pub fn single(&mut self, t: T) -> BumpVec<T>
Create a new BumpVec
with a single element. The capacity is
also only one element; growing the vector further will require
a reallocation.
sourcepub fn from_iter<I: Iterator<Item = T>>(&mut self, i: I) -> BumpVec<T>
pub fn from_iter<I: Iterator<Item = T>>(&mut self, i: I) -> BumpVec<T>
Create a new BumpVec
with the sequence from an iterator.