SafeStorage: CEDAR DEFINITIONS = BEGIN GetSystemZone: PROC RETURNS [ZONE]; GetPermanentZone: PROC RETURNS [ZONE]; GetUntracedZone: UNSAFE PROC RETURNS [ZONE]; NewObject: PRIVATE PROC [nUnits: INT, type: SafeStorage.Type] RETURNS [REF] ~ TRUSTED MACHINE CODE { "XR_NewObject" }; NewUntracedObject: PROC [nUnits: INT, type: Type] RETURNS [REF] ~ TRUSTED MACHINE CODE { "XR_NewUntracedObject" }; GetTypeIndex: PRIVATE PROC [typeString: STRING, struct, rcmap: POINTER] RETURNS [Type] ~ TRUSTED MACHINE CODE { "XR_GetTypeIndex" }; SetCollectionInterval: PROC [newInterval: CARD] RETURNS [previous: CARD]; ReclaimCollectibleObjects: PROC [suspendMe: BOOL ¬ TRUE, traceAndSweep: BOOL ¬ FALSE]; ReclamationReason: TYPE = {clientRequest, clientTAndSRequest, clientNoTraceRequest, rcTableOverflow, allocationInterval, quantaNeeded, finalizationThreshold}; IsCollectorActive: PROC RETURNS[active: BOOL, previousIncarnation: INT]; WaitForCollectorStart: PROC RETURNS[incarnation: INT, reason: ReclamationReason, wordsAllocated, objectsAllocated: INT -- since previous collection was initiated --]; WaitForCollectorDone: PROC RETURNS[incarnation: INT, reason: ReclamationReason, wordsReclaimed: INT, objectsReclaimed: INT]; CurrentByteCount: PROC RETURNS [CARD]; CurrentObjectCount: PROC RETURNS [CARD]; TotalByteCount: PROC RETURNS [CARD]; TotalObjectCount: PROC RETURNS [CARD]; HeapSize: PROC RETURNS [CARD]; TypeIndex: TYPE = CARDINAL; Type: TYPE = MACHINE DEPENDENT {null(0), last(TypeIndex.LAST)}; nullType: Type = VAL[0]; unspecType: Type = VAL[1]; -- the distinguished type of UNSPECIFIED fhType: Type = VAL[2]; -- the distinguished type of localFrames gfhType: Type = VAL[3]; -- the distinguished type of globalFrames anyType: Type = VAL[4]; -- the distinguished type of ANY lastPredefinedTypeIndex: TypeIndex = 4; GetReferentType: PROC[ref: REF ANY] RETURNS[type: Type]; GetCanonicalReferentType: PROC[ref: REF ANY] RETURNS[type: Type]; EquivalentTypes: PROC[t1, t2: Type] RETURNS[BOOL]; GetCanonicalType: PROC[type: Type] RETURNS[Type]; IsReferentType: PROC[ref: REF ANY, type: Type] RETURNS[BOOL]; NarrowRef: PROC[ref: REF ANY, type: Type] RETURNS[REF ANY]; MemoryExhausted: ERROR; NarrowFault: ERROR; NarrowRefFault: ERROR [ref: REF ANY, targetType: Type]; UnsafeProcAssignment: SIGNAL [proc: PROC ANY RETURNS ANY]; InvalidType: ERROR [type: Type]; END. ( SafeStorage.mesa Copyright Σ 1985, 1986, 1991, 1992 by Xerox Corporation. All rights reserved. Paul Rovner, September 19, 1983 9:01 pm Russ Atkinson (RRA) February 1, 1985 11:32:30 am PST Beach, February 22, 1985 11:20:38 am PST Doug Wyatt, November 14, 1986 4:20:51 pm PST Carl Hauser, March 30, 1988 3:21:37 pm PST Willie-s, March 3, 1992 12:19 pm PST Michael Plass, November 22, 1991 10:48 am PST Zones this is the default ZONE used by NEW use this for NEW objects that will never be collected use this for NEW objects that are known to contain no REFs Access to the underlying allocator Controlling the garbage collector establishes the number of bytes allocated between collections perform a garbage collection Monitoring the garbage collector Statistics The current number of bytes allocated. This number increases continuously (at each allocation) but shrinks only after collections. The current number of objects allocated. This number increases continuously (at each allocation) but shrinks only after collections. The total number of bytes allocated since startup. This number increases continuously. The total number of objects allocated since startup. This number increases continuously. The size of the heap in bytes. Types Predefined Types. All of these are treated specially by the implemention There will be other predefined Types. ... gets the canonical type for the given type ... tests the two types for equivalence (GetCanonicalType[t1] = GetCanonicalType[t2]) ... gets the canonical type for the given type ... tests the given ref for having the given referent type Like NARROW, but uses a type code. Raises NarrowRefFault if the given ref does not have that type. Signals and Errors Willie Sue Orr, July 25, 1991 3:36:17 pm PDT: folded in SafeStorageExtras Michal Plass, November 22, 1991: removed finalization procs; use Finalization instead. Also added UnsafeProcAssignment check, rationalized statistics, removed other unimplemented procedures. Willie Sue Orr, March 3, 1992 12:18:52 pm PST: changed TypeIndex to be CARDINAL instead of CARD16. Κυ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ΟeœC™NKšœ'™'K™4J™(K™,K™*K™$K™-—K˜KšΠbl œΟkœŸ ˜KšœŸ˜head™šΟn œŸœŸœŸœ˜#KšœŸœ Ÿ™$K˜—š œŸœŸœŸœ˜&Kšœ Ÿœ%™5K™—š  œŸœŸœŸœŸœ˜,Kšœ Ÿœ*™:K˜——™"š  œŸœŸœ ŸœŸœŸœŸœŸœŸœ˜dK˜K˜K˜—š œŸœ ŸœŸœŸœŸœŸœŸœ˜XK˜K˜K˜—š  œŸœŸœŸœŸœŸœ ŸœŸœŸœ˜oK˜K˜—K˜—šœ!™!š  œŸœŸœŸœ Ÿœ˜IKšœΟcœ™=K˜—š  œŸœ ŸœŸœŸœŸœ˜VKšœ™——šœ ™ KšœŸœ‡˜žK˜š  œŸœŸœ ŸœŸœ˜HK˜—š  œŸœŸœŸœ@Ÿœ‘-œ˜§K™—Kš  œŸœŸœŸœ.ŸœŸœ˜}—šœ ™ š œŸœŸœŸœ˜&J™ƒ—K˜š œŸœŸœŸœ˜(J™…K˜—š œŸœŸœŸœ˜$J™WK˜—š œŸœŸœŸœ˜&J™YK™—š œŸœŸœŸœ˜J™——™šœ ŸœŸœ˜K˜—Kš œŸœŸœŸ œŸœ˜?K˜KšœŸœ˜KšœŸœ‘(˜DKšœŸœ‘(˜@KšœŸœ‘)˜AKšœŸœ‘ ˜8šœ'˜'KšœI™IKšœ%™%—K˜š  œŸœŸœŸœŸœ ˜8K˜—š  œŸœŸœŸœŸœ ˜AK™.K˜—š œŸœŸœŸœ˜2KšœU™UK˜—š œŸœ Ÿœ˜1K™.K˜—š  œŸœŸœŸœŸœŸœ˜=K™:K˜—š  œŸœŸœŸœŸœŸœŸœ˜;KšœŸœ™"Kšœ?™?K˜——šœ™š œŸœ˜K˜—š  œŸœ˜K˜—š œŸœŸœŸœ˜7K˜—š  œŸœŸœŸœŸœŸœ˜:K˜—Kš  œŸœ˜ —K˜KšŸœ˜K˜K™KšœI™IKšœc œH™ΏK™b—…— Ro