ZoneIndicesImpl.Mesa
last edited May 17, 1983 2:42 pm by Paul Rovner
DIRECTORY
RTZones USING[nZiMaxInit, MapZiZn, ZoneIndex];
ZoneIndicesImpl: MONITOR -- protects ziNext
IMPORTS RTZones
EXPORTS RTZones
= BEGIN OPEN RTZones;
TooManyZones: ERROR = CODE;
Global variables
ziNext: ZoneIndex;
PUBLIC procedures
GetZiNext: PUBLIC PROC RETURNS[zi: ZoneIndex] = {RETURN[ziNext]};
SetZiNext: PUBLIC ENTRY PROC[zi: ZoneIndex] = {ziNext ← zi};
called by RTZonesImpl start code
AllocateZi: PUBLIC ENTRY PROC RETURNS[zi: ZoneIndex] = {
ENABLE UNWIND => NULL;
IF ziNext = nZiMaxInit THEN {
FOR zi IN [1..nZiMaxInit]
DO IF MapZiZn[zi] = NIL THEN RETURN[zi] ENDLOOP;
ERROR TooManyZones};
zi ← ziNext;
ziNext ← ziNext+1;
};
END.