SafeStorage: CEDAR DEFINITIONS = BEGIN TrimSystemZone: PROC; GetSystemZone: PROC RETURNS[ZONE]; GetPermanentZone: PROC RETURNS[ZONE]; SetCollectionInterval: PROC[newInterval: INT--words--] RETURNS[previous: INT]; 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: INT, --since previous collection was initiated objectsAllocated: INT]; WaitForCollectorDone: PROC RETURNS[ incarnation: INT, reason: ReclamationReason, wordsReclaimed: INT, objectsReclaimed: INT]; NWordsAllocated: PROC RETURNS[INT]; -- returns total # words allocated NWordsReclaimed: PROC RETURNS[INT]; -- returns total # words reclaimed PinObject: PROC[ref: REF ANY]; -- pins the object and its header in real memory UnpinObject: PROC[ref: REF ANY]; TypeIndex: TYPE = [0..LAST[CARDINAL]/4]; -- 14 bits Type: TYPE = RECORD[TypeIndex]; nullType: Type = [0]; unspecType: Type = [1]; -- the distinguished type of UNSPECIFIED fhType: Type = [2]; -- the distinguished type of localFrames gfhType: Type = [3]; -- the distinguished type of globalFrames anyType: Type = [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]; maxNPackageRefs: CARDINAL = 2; FinalizationQueue: TYPE = PRIVATE RECORD[REF ANY]; EstablishFinalization: PROC[type: Type, npr: [0..maxNPackageRefs], fq: FinalizationQueue]; ReEstablishFinalization: PROC[type: Type, npr: [0..maxNPackageRefs], fq: FinalizationQueue]; EnableFinalization: PROC[ref: REF ANY]; IsFinalizationEnabled: PROC[ref: REF ANY] RETURNS[BOOL]; NewFQ: PROC[length: CARDINAL _ 10--refs--] RETURNS[FinalizationQueue]; FQNext: PROC[fq: FinalizationQueue] RETURNS[REF ANY]; -- waits 'till there is one FQEmpty: PROC[fq: FinalizationQueue] RETURNS[BOOL]; PutTypeAttachment: PROC[type: Type, attachment: REF ANY]; GetTypeAttachment: PROC[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]; CantEstablishFinalization: ERROR[type: Type]; END.  SafeStorage.Mesa last edited September 19, 1983 9:01 pm by Paul Rovner ZONEs returns free VM pages to the operating system this is the default ZONE used by NEW use this for NEW objects that will never be collected Controlling the garbage collector establishes the number of words allocated between collections perform a garbage collection Monitoring the garbage collector Statistics Pinning objects in real memory (not implemented until the newsafestorage stuff is in) TYPEs predefined Types. All of these are treated specially by the implemention There will be other predefined Types. Raises NarrowRefFault Package finalization BEWARE Establish finalization for a type BEFORE allocating any objects of the type. Allocate objects of the type ONLY in the same program module in which the calls to establish finalization appear. Use the exact same type expression in these calls and in NEW expressions for objects of the type. Invoke ClearFinalizedFlag after each new finalizable object has been inserted in its package data structure (i.e. after its "package refs" have been created). EstablishFinalization will raise CantEstablishFinalization if type was previously finalizable. Use this to specify a new FinalizationQueue for a previously established finalizable type. This is useful during the edit-compile-test loop for running new versions of a program that establishes finalization for a Type. ReEstablishFinalization will raise CantEstablishFinalization if type was not previously finalizable or if the new number of package refs is different than before. Use this for a new finalizable object after establishing its package refs. Use this in conjunction with a finalizable cache. This will be implemented when the NewSafeStorage stuff is in place. Type attachments SIGNALs and ERRORs Ê ˜Jšœ™Jšœ5™5˜Jšœ Ïkœ ˜šœ˜J˜™šÏnœœ˜J™-—J˜šž œœœœ˜"Jšœ$™$—J˜šžœœœœ˜%Jšœ5™5——J˜šœ!™!š žœœÏc œœ œ˜NJšœŸœ™=—J˜šžœ˜š œ œœœœ˜:Jšœ™———J˜šœ ™ šœœ˜J˜„—J˜Jš žœœœ œœ˜HJ˜šžœ˜šœ˜Jšœ œ˜J˜JšœœŸ)˜?Jšœœ˜——J˜šžœ˜šœ˜Jšœ œ˜J˜Jšœœ˜Jšœœ˜———J™šœ ™ Jš žœœœœŸ"˜GJ˜Jš žœœœœŸ"˜F—J™™UJš ž œœœœŸ0˜PJ˜Jšž œœœœ˜ —J˜™Jšœ œœœŸ ˜4J˜šœœœ ˜šœI™IJšœ˜JšœŸ(˜AJšœŸ(˜=JšœŸ)˜>JšœŸ ˜5J˜Jšœ'˜'—Jšœ%™%—J˜Jš žœœœœœ ˜8J˜Jš žœœœœœ ˜AJ˜Jšžœœœœ˜2J˜Jšžœœ œ˜1J˜Jš žœœœœœœ˜=J˜šž œœœœœœœ˜;Jšœ™—J˜šœ™šœ™JšœL™LJšœÓ™ÓJšœž™ž—Jšœœ˜Jš œœœœœœ˜2J˜šœ˜šœ?˜CJšœ^™^——šÏbœ˜šœ?˜CJšœÜ™ÜJšœ¢™¢——J˜šžœœœœ˜'JšœJ™J—J˜š œ#˜8Jšœv™v—J˜Jš žœœ œŸœœ˜FJš žœœœœœŸ˜RJšžœœœœ˜3—J™™Jšžœœœœ˜9Jš žœœ œœœ˜5J˜——J˜šœ™Jšœœ˜Jšœ œ˜Jšœœœœ˜6Jš œœœœœœ˜9Jšœ œ ˜Jšœœ ˜-J˜——J˜Jšœ˜—J˜—…— Øí