pub struct DefragmentationEngine { /* private fields */ }Expand description
Memory defragmentation engine
Implementations§
Source§impl DefragmentationEngine
impl DefragmentationEngine
pub fn new(config: DefragConfig) -> Self
Sourcepub fn should_defragment(&mut self) -> bool
pub fn should_defragment(&mut self) -> bool
Check if defragmentation should be triggered
Sourcepub fn defragment(&mut self) -> Result<CompactionResult, DefragError>
pub fn defragment(&mut self) -> Result<CompactionResult, DefragError>
Trigger defragmentation
Sourcepub fn create_task(
&mut self,
start_addr: usize,
size: usize,
algorithm: CompactionAlgorithm,
priority: TaskPriority,
) -> u64
pub fn create_task( &mut self, start_addr: usize, size: usize, algorithm: CompactionAlgorithm, priority: TaskPriority, ) -> u64
Create a defragmentation task
Sourcepub fn get_stats(&self) -> &DefragStats
pub fn get_stats(&self) -> &DefragStats
Get current statistics
Sourcepub fn get_performance_history(&self) -> &VecDeque<DefragPerformance>
pub fn get_performance_history(&self) -> &VecDeque<DefragPerformance>
Get performance history
Sourcepub fn update_layout(
&mut self,
allocated_blocks: HashMap<usize, AllocatedBlock>,
free_regions: BTreeMap<usize, FreeRegion>,
)
pub fn update_layout( &mut self, allocated_blocks: HashMap<usize, AllocatedBlock>, free_regions: BTreeMap<usize, FreeRegion>, )
Update memory layout
Sourcepub fn get_layout(&self) -> &MemoryLayoutTracker
pub fn get_layout(&self) -> &MemoryLayoutTracker
Get current memory layout
Trait Implementations§
impl Send for DefragmentationEngine
impl Sync for DefragmentationEngine
Auto Trait Implementations§
impl Freeze for DefragmentationEngine
impl !RefUnwindSafe for DefragmentationEngine
impl Unpin for DefragmentationEngine
impl UnsafeUnpin for DefragmentationEngine
impl !UnwindSafe for DefragmentationEngine
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
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