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> UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more