Struct cranelift_entity::ListPool
source · pub struct ListPool<T: EntityRef + ReservedValue> { /* private fields */ }
Expand description
A memory pool for storing lists of T
.
Implementations
sourceimpl<T: EntityRef + ReservedValue> ListPool<T>
impl<T: EntityRef + ReservedValue> ListPool<T>
sourcepub fn with_capacity(len: usize) -> Self
pub fn with_capacity(len: usize) -> Self
Create a new list pool with the given capacity for data pre-allocated.
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Get the capacity of this pool. This will be somewhat higher than the total length of lists that can be stored without reallocating, because of internal metadata overheads. It is mostly useful to allow another pool to be allocated that is likely to hold data transferred from this one without the need to grow.
Trait Implementations
sourceimpl<T: EntityRef + ReservedValue> Default for ListPool<T>
impl<T: EntityRef + ReservedValue> Default for ListPool<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ListPool<T>where
T: RefUnwindSafe,
impl<T> Send for ListPool<T>where
T: Send,
impl<T> Sync for ListPool<T>where
T: Sync,
impl<T> Unpin for ListPool<T>where
T: Unpin,
impl<T> UnwindSafe for ListPool<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more