pub struct ClockPageReplacer<T: Page> { /* private fields */ }Expand description
A page replacer based on the clock page replacement algorithm.
§Usage
Every time you allocate a physical memory page, you should call
register to register it to the replacer.
You don’t need to unregister a page when it’s evicted from the physical memory, because the replacer will automatically remove it when it becomes invalid.
When you need to replace a page, call the replace method to get the
page to replace. The page is automatically removed from the replacer.
Implementations§
Source§impl<T: Page> ClockPageReplacer<T>
impl<T: Page> ClockPageReplacer<T>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ClockPageReplacer.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ClockPageReplacer<T>
impl<T> RefUnwindSafe for ClockPageReplacer<T>where
T: RefUnwindSafe,
impl<T> Send for ClockPageReplacer<T>where
T: Send,
impl<T> Sync for ClockPageReplacer<T>where
T: Sync,
impl<T> Unpin for ClockPageReplacer<T>where
T: Unpin,
impl<T> UnwindSafe for ClockPageReplacer<T>where
T: UnwindSafe,
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