pub enum PoolType {
ExclusivePages {
max_alloc_size: u64,
},
SlicedPages {
page_size: u64,
max_slice_size: u64,
max_pool_size: Option<u64>,
},
}Expand description
The type of memory pool to use.
Variants§
ExclusivePages
Use a memory where every allocation is a separate page.
SlicedPages
Use a memory where each allocation is a slice of a bigger allocation.
Fields
§
max_pool_size: Option<u64>Hard cap on the total bytes of pages this pool may hold.
The effective cap is floor(max_pool_size / page_size) whole pages.
If max_pool_size < page_size, the page size is shrunk to the
(alignment-rounded) cap so the budget is honored with a single page.
When the cap is reached and no free slice fits after coalescing,
reserving returns IoError
PoolCapacityExceeded instead of silently growing. None (the
previous behavior) keeps unbounded growth.
Note: runtimes that create one memory management per stream (CUDA, HIP) apply the cap per stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PoolType
impl RefUnwindSafe for PoolType
impl Send for PoolType
impl Sync for PoolType
impl Unpin for PoolType
impl UnsafeUnpin for PoolType
impl UnwindSafe for PoolType
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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