pub struct MemoryPoolOptions {
pub pool_type: PoolType,
pub page_size: u64,
pub chunk_num_prealloc: u64,
pub dealloc_period: Option<u64>,
}
Expand description
Options to create a memory pool.
Fields§
§pool_type: PoolType
What kind of pool to use.
page_size: u64
The amount of bytes used for each chunk in the memory pool.
chunk_num_prealloc: u64
The number of chunks allocated directly at creation.
Useful when you know in advance how much memory you’ll need.
dealloc_period: Option<u64>
Period after which allocations are deemed unused and deallocated.
This period is measured in the number of allocations in the parent allocator. If a page in the pool was unused for the entire period, it will be deallocated. This period is approximmate, as checks are only done occasionally.
Trait Implementations§
Source§impl Clone for MemoryPoolOptions
impl Clone for MemoryPoolOptions
Source§fn clone(&self) -> MemoryPoolOptions
fn clone(&self) -> MemoryPoolOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MemoryPoolOptions
impl RefUnwindSafe for MemoryPoolOptions
impl Send for MemoryPoolOptions
impl Sync for MemoryPoolOptions
impl Unpin for MemoryPoolOptions
impl UnwindSafe for MemoryPoolOptions
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