|
contur2
|
Abstract interface for page replacement algorithms. More...
#include <i_page_replacement.h>

Public Member Functions | |
| virtual | ~IPageReplacementPolicy ()=default |
| virtual std::string_view | name () const noexcept=0 |
| Returns the name of the algorithm (e.g., "FIFO", "LRU"). | |
| virtual FrameId | selectVictim (const PageTable &pageTable)=0 |
| Selects a victim frame to evict. | |
| virtual void | onAccess (FrameId frame)=0 |
| Notifies the policy that a frame was accessed (read or write). | |
| virtual void | onLoad (FrameId frame)=0 |
| Notifies the policy that a new page was loaded into a frame. | |
| virtual void | reset ()=0 |
| Resets the policy's internal state. | |
Abstract interface for page replacement algorithms.
The MMU consults this policy to decide which physical frame to evict when a page fault occurs and no free frames are available. Implementations: FIFO, LRU, Clock, Optimal.
Definition at line 19 of file i_page_replacement.h.
|
virtualdefault |
|
nodiscardpure virtualnoexcept |
Returns the name of the algorithm (e.g., "FIFO", "LRU").
Implemented in contur::ClockReplacement, contur::FifoReplacement, contur::LruReplacement, and contur::OptimalReplacement.
|
pure virtual |
Notifies the policy that a frame was accessed (read or write).
Implemented in contur::ClockReplacement, contur::FifoReplacement, contur::LruReplacement, and contur::OptimalReplacement.
|
pure virtual |
Notifies the policy that a new page was loaded into a frame.
Implemented in contur::ClockReplacement, contur::FifoReplacement, contur::LruReplacement, and contur::OptimalReplacement.
|
pure virtual |
Resets the policy's internal state.
Implemented in contur::ClockReplacement, contur::FifoReplacement, contur::LruReplacement, and contur::OptimalReplacement.
|
nodiscardpure virtual |
Selects a victim frame to evict.
| pageTable | The current page table state. |
Implemented in contur::ClockReplacement, contur::FifoReplacement, contur::LruReplacement, and contur::OptimalReplacement.