CacheModels.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Bertrand Serlet, April 4, 1985 5:31:54 pm PST
Last Edited by: Serlet, April 12, 1985 2:32:35 pm PST
Last Edited by: Sindhu, May 7, 1985 11:29:20 am PDT
Pradeep Sindhu February 17, 1986 3:56:23 pm PST
DIRECTORY
DragOpsCross USING [Word],
IO USING [STREAM],
Rope USING [ROPE];
CacheModels: 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
fetch: CacheFetchProc ← NIL, -- this hook allows the user to intercept cache accesses
store: CacheStoreProc ← NIL, -- this hook allows the user to intercept cache accesses
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
data: REFNIL-- private data for clients intercepting fetch & store
];
CacheFetchProc: TYPE = PROC [cache: Cache, addr: Word, fromJump: BOOLFALSE];
CacheStoreProc: TYPE = PROC [cache: Cache, addr: Word];
CacheResetProc: TYPE = PROC [cache: Cache];
CacheFlushProc: TYPE = PROC [cache: Cache];
CachePrintProc: TYPE = PROC [cache: Cache, stream: IO.STREAM, name: Rope.ROPE, resetStatistics: BOOLTRUE];
Short ways of calling
Fetch: CacheFetchProc;
Store: CacheStoreProc;
Reset: CacheResetProc;
Flush: CacheFlushProc;
Print: CachePrintProc;
END.