TLCacheModels.mesa
Written By: Pradeep Sindhu, August 19, 1985 4:57:12 pm PDT
Pradeep Sindhu August 19, 1985 5:32:51 pm PDT
DIRECTORY
DragOpsCross USING [Word],
IO USING [STREAM],
Rope USING [ROPE];
TLCacheModels: CEDAR DEFINITIONS = BEGIN
Basic Types
Word: TYPE = DragOpsCross.Word;
wordsPerPage: CARDINAL = 128;
logWordsPerPage: CARDINAL = 7;
Cache Related Types
Cache: TYPE = REF CacheRec;
CacheRec: TYPE = RECORD [
private: REFNIL, -- private data to the cache implementation
pbus: PBusModel.PBus ← NIL,
phACycle: CacheCycleProc ← NIL,
phBCycle: CacheCycleProc ← NIL,
reset: CacheResetProc ← NIL, -- Resets the given cache to its initial state
flush: CacheFlushProc ← NIL, -- Forget everything it knows, but don't effect stats
print: CachePrintProc ← NIL, -- Print statistics, and eventually resets them
];
CacheCycleProc: TYPE = PROC [cache: Cache];
CacheResetProc: TYPE = PROC [cache: Cache];
CacheFlushProc: TYPE = PROC [cache: Cache];
CachePrintProc: TYPE = PROC [cache: Cache, stream: IO.STREAM, name: Rope.ROPE, resetStatistics: BOOLTRUE];
The cache procedures
PhACycle: CacheCycleProc;
PhBCycle: CacheCycleProc;
Reset: CacheResetProc;
Flush: CacheFlushProc;
Print: CachePrintProc;
END.