contur2
Loading...
Searching...
No Matches
i_page_replacement.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <string_view>
7
8#include "contur/core/types.h"
9
11
12namespace contur {
13
20 {
21 public:
22 virtual ~IPageReplacementPolicy() = default;
23
25 [[nodiscard]] virtual std::string_view name() const noexcept = 0;
26
30 [[nodiscard]] virtual FrameId selectVictim(const PageTable &pageTable) = 0;
31
33 virtual void onAccess(FrameId frame) = 0;
34
36 virtual void onLoad(FrameId frame) = 0;
37
39 virtual void reset() = 0;
40 };
41
42} // namespace contur
Abstract interface for page replacement algorithms.
virtual void onLoad(FrameId frame)=0
Notifies the policy that a new page was loaded into a frame.
virtual FrameId selectVictim(const PageTable &pageTable)=0
Selects a victim frame to evict.
virtual void reset()=0
Resets the policy's internal state.
virtual ~IPageReplacementPolicy()=default
virtual void onAccess(FrameId frame)=0
Notifies the policy that a frame was accessed (read or write).
virtual std::string_view name() const noexcept=0
Returns the name of the algorithm (e.g., "FIFO", "LRU").
Page table mapping virtual page numbers to physical frames.
Definition page_table.h:27
Definition block.h:15
std::uint32_t FrameId
Frame number in physical memory.
Definition types.h:43
PageTable — virtual-to-physical frame mapping with status bits.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...