pub struct AlignedPool<T, const ALIGN: usize = DEFAULT_ALIGN> { /* private fields */ }Expand description
A typed memory pool for aligned allocations.
Unlike MemoryPool, this uses AlignedVec for SIMD-friendly allocations.
Implementations§
Source§impl<T: Clone, const ALIGN: usize> AlignedPool<T, ALIGN>
impl<T: Clone, const ALIGN: usize> AlignedPool<T, ALIGN>
Sourcepub fn with_limit(max_cached: usize) -> Self
pub fn with_limit(max_cached: usize) -> Self
Creates a pool with a custom cache limit.
Sourcepub fn acquire(&mut self, min_capacity: usize) -> AlignedVec<T, ALIGN>
pub fn acquire(&mut self, min_capacity: usize) -> AlignedVec<T, ALIGN>
Acquires an aligned buffer with at least the given capacity.
Sourcepub fn release(&mut self, buffer: AlignedVec<T, ALIGN>)
pub fn release(&mut self, buffer: AlignedVec<T, ALIGN>)
Returns an aligned buffer to the pool.
Trait Implementations§
Auto Trait Implementations§
impl<T, const ALIGN: usize> Freeze for AlignedPool<T, ALIGN>
impl<T, const ALIGN: usize> RefUnwindSafe for AlignedPool<T, ALIGN>where
T: RefUnwindSafe,
impl<T, const ALIGN: usize> Send for AlignedPool<T, ALIGN>where
T: Send,
impl<T, const ALIGN: usize> Sync for AlignedPool<T, ALIGN>where
T: Sync,
impl<T, const ALIGN: usize> Unpin for AlignedPool<T, ALIGN>
impl<T, const ALIGN: usize> UnwindSafe for AlignedPool<T, ALIGN>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more