pub struct LgAlloc {
pub enabled: Option<bool>,
pub path: Option<PathBuf>,
pub background_config: Option<BackgroundWorkerConfig>,
pub eager_return: Option<bool>,
pub file_growth_dampener: Option<usize>,
pub local_buffer_bytes: Option<usize>,
}
Expand description
Lgalloc configuration
Fields§
§enabled: Option<bool>
Whether the allocator is enabled or not.
path: Option<PathBuf>
Path where files reside.
background_config: Option<BackgroundWorkerConfig>
Configuration of the background worker.
eager_return: Option<bool>
Whether to return physical memory on deallocate
file_growth_dampener: Option<usize>
Dampener in the file growth rate. 0 corresponds to doubling and in general n
to 1+1/(n+1)
.
local_buffer_bytes: Option<usize>
Size of the per-thread per-size class cache, in bytes.
Implementations§
Source§impl LgAlloc
impl LgAlloc
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new configuration. All values are initialized to their default (None) values.
Sourcepub fn with_background_config(
&mut self,
config: BackgroundWorkerConfig,
) -> &mut Self
pub fn with_background_config( &mut self, config: BackgroundWorkerConfig, ) -> &mut Self
Set the background worker configuration.
Sourcepub fn eager_return(&mut self, eager_return: bool) -> &mut Self
pub fn eager_return(&mut self, eager_return: bool) -> &mut Self
Enable eager memory reclamation.
Sourcepub fn file_growth_dampener(&mut self, file_growth_dapener: usize) -> &mut Self
pub fn file_growth_dampener(&mut self, file_growth_dapener: usize) -> &mut Self
Set the file growth dampener.
Sourcepub fn local_buffer_bytes(&mut self, local_buffer_bytes: usize) -> &mut Self
pub fn local_buffer_bytes(&mut self, local_buffer_bytes: usize) -> &mut Self
Set the local buffer size.
Trait Implementations§
impl Eq for LgAlloc
impl StructuralPartialEq for LgAlloc
Auto Trait Implementations§
impl Freeze for LgAlloc
impl RefUnwindSafe for LgAlloc
impl Send for LgAlloc
impl Sync for LgAlloc
impl Unpin for LgAlloc
impl UnwindSafe for LgAlloc
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