53 [[nodiscard]]
virtual std::size_t
totalSlots() const noexcept = 0;
56 [[nodiscard]] virtual std::
size_t freeSlots() const noexcept = 0;
Block — the fundamental unit of simulated memory.
Abstract interface for virtual memory management.
virtual Result< void > loadSegment(ProcessId processId, const std::vector< Block > &data)=0
Loads a code/data segment into a process's virtual address space.
virtual bool hasSlot(ProcessId processId) const noexcept=0
Checks whether a process has an allocated slot.
virtual std::size_t freeSlots() const noexcept=0
Returns the number of free (unallocated) slots.
virtual Result< std::vector< Block > > readSegment(ProcessId processId) const =0
Reads the entire code/data segment from a process's virtual memory.
virtual Result< MemoryAddress > allocateSlot(ProcessId processId, std::size_t size)=0
Allocates a virtual memory slot for a process.
virtual ~IVirtualMemory()=default
virtual Result< void > freeSlot(ProcessId processId)=0
Frees a previously allocated slot.
virtual std::size_t slotSize(ProcessId processId) const noexcept=0
Returns the slot size (number of blocks) for a process, or 0 if no slot.
virtual std::size_t totalSlots() const noexcept=0
Returns the number of total slots available.
A result type that holds either a success value of type T or an ErrorCode.
Error codes and Result<T> type for fallible operations.
std::uint32_t ProcessId
Unique identifier for a process.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...