Struct xalloc::arena::pooled::PooledArena
[−]
[src]
pub struct PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug, { /* fields omitted */ }
Adds a vacant entry pool to any memory arena for faster reallocation.
Methods
impl<T, A, P> PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
pub fn new(inner: A) -> Self
[src]
Construct a PooledArena
.
pub fn with_capacity(inner: A, capacity: usize) -> Self
[src]
Construct a PooledArena
with the specified number of pre-allocated
entries.
pub fn purge(&mut self)
[src]
Discard all vacant entries.
Trait Implementations
impl<T: Debug, A: Debug, P: Debug> Debug for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T, A, P> UnsafeArena<T> for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P>,
P: Clone + Default + PartialEq + Eq + Debug,
type Ptr = A::Ptr
Pointer type. Read more
fn insert(&mut self, x: T) -> Self::Ptr
[src]
Insert a value into the arena. Read more
unsafe fn get_unchecked(&self, ptr: &Self::Ptr) -> &T
[src]
Get a reference to a contained value, without a pointer validity check.
unsafe fn get_unchecked_mut(&mut self, ptr: &Self::Ptr) -> &mut T
[src]
Get a mutable reference to a contained value, without a pointer validity check. Read more
unsafe fn remove_unchecked(&mut self, ptr: &Self::Ptr) -> T
[src]
Remove a value from the arena, without a pointer validity check. Read more
fn reserve(&mut self, _additional: usize)
[src]
Reserves capacity for at least additional
values to be inserted in the arena.
impl<T, A, P> UnsafeArenaWithMembershipCheck<T> for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P> + UnsafeArenaWithMembershipCheck<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P> + UnsafeArenaWithMembershipCheck<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
unsafe fn contains_unchecked(&self, ptr: &Self::Ptr) -> bool
[src]
Return true
if the pointer was created from the same instance of the arena. Read more
impl<T, A, P> Arena<T> for PooledArena<T, A, P> where
A: UnsafeArena<Entry<T, P>, Ptr = P> + Arena<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
[src]
A: UnsafeArena<Entry<T, P>, Ptr = P> + Arena<Entry<T, P>>,
P: Clone + Default + PartialEq + Eq + Debug,
Auto Trait Implementations
impl<T, A, P> Send for PooledArena<T, A, P> where
A: Send,
P: Send,
T: Send,
A: Send,
P: Send,
T: Send,
impl<T, A, P> Sync for PooledArena<T, A, P> where
A: Sync,
P: Sync,
T: Sync,
A: Sync,
P: Sync,
T: Sync,