45.1 ISUT
ISUT is the pure abstract interface for the persistent representation of the
Segment Utilisation Table. It provides the operations that the
SUT facade needs without exposing whether the utilisations are held by
SmallSUT or LargeSUT.
The interface contains only the operations common to the two representations. Persistent
utilisation storage and the number of allocated segments belong to the selected implementation.
Higher-level operations—including applying utilisation offsets, allocating SegIds, managing free
segments and reservations, and synchronization—remain in the SUT facade and related
classes.
Interface
struct ISUT
{
virtual void Serialise(Archive& ar) const = 0;
virtual void Deserialise(InputArchive& ar) = 0;
virtual int GetUtilisation(SegId segid) const = 0;
virtual void SetUtilisation(SegId segid, int u) = 0;
virtual int GetTotalNumSegments() const = 0;
virtual void IncrementTotalNumSegments() = 0;
};
GetUtilisation() and SetUtilisation() read and replace the exact utilisation
for one segment. GetTotalNumSegments() and IncrementTotalNumSegments() expose the
size of the allocated segment address space. Higher-level operations, such as applying a positive or
negative utilisation offset and allocating a SegId, are implemented by the SUT facade in
terms of these primitives.
Serialise() and Deserialise() persist and restore the implementation's root
state. They do not imply that every implementation stores every utilisation directly in the root
block: for LargeSUT, that state includes references to separately checkpointed SUT sections.