Object <- BlockCluster |
|
|
Active IsPackageCluster IsPersistentCluster IsROMCluster TargetHeap |
| Field | Type | |
|---|---|---|
| BlockCluster: | sharedObjectUnshared: | Boolean |
| isPackageCluster: | Boolean | |
| isROMCluster: | Boolean | |
| keep: | Boolean | |
| deleteChanges: | Boolean | |
| keepAfterCommit: | Boolean | |
| sourceRoster: | VolumeRosterPointer | |
| firstPageIndex: | Unsigned | |
| lastPageIndex: | Unsigned | |
| firstUncrowdedPageIndex: | Unsigned |
instance BlockCluster tag; sharedObjectUnshared: false; isPackageCluster: false; isROMCluster: false; keep: false; deleteChanges: false; keepAfterCommit: false; sourceRoster: 0; firstPageIndex: 0; lastPageIndex: 0; firstUncrowdedPageIndex: 0; end instance;
Define Class BlockCluster; inherits from Object; field sharedObjectUnshared: Boolean; // this is true while any uncommitted changes exist that change // a shared object into an unshared one field isPackageCluster: Boolean, getter; field isROMCluster: Boolean, getter; field keep: Boolean; // if true, keep at next reboot // if false, delete as part of booting field deleteChanges: Boolean; // if true, delete all the changes at next reboot // keeping only the persistent objects field keepAfterCommit: Boolean; // overwrite keep bit with this bit next time we commit // this way, we can set up a package so it will be kept only after committing it // or set up a package so it will be destroyed only if the next commit happens field sourceRoster: VolumeRosterPointer; // NOTE: the isPackageCluster and sourceRoster fields are // used in the implementation of "cdump." If you change them in any way, you // might need to change MagicDebugLib, GDB, or the MacsBug "cdump" dcmd // implementation as well. field firstPageIndex: Unsigned; // actually LocatorPageIndex // Index of first page of cluster field lastPageIndex: Unsigned; // actually LocatorPageIndex // Index of last page of cluster field firstUncrowdedPageIndex: Unsigned; // actually LocatorPageIndex // Index of first page in cluster that MIGHT contain a free locator or nullPageIndex if none // It's always OK to set firstUncrowdedPageIndex to firstPageIndex; on the other hand, cluster pages // that occur earlier than firstUncrowdedPageIndex in the cluster's linked list of pages must not // contain any free locators. attribute IsPackageCluster: Boolean, readOnly; // currently a faster version of Implements(self, PackageCluster_) attribute IsROMCluster: Boolean, readOnly; // returns true if cluster originated in ROM, false if it was newly // created in RAM attribute IsPersistentCluster: Boolean, readOnly; // currently faster version of Implements(self, PersistentCluster_) attribute TargetHeap: RAMHeapPointer, readOnly; // used to obtain the heap into which new objects, shadows, etc. go // creation overrides Init; operation InitCluster(parameters: ReadOnlyPointer); class operation NewCluster(heap: RAMHeapPointer; parameters: ReadOnlyPointer): Object; // Call instead of New to allocate a cluster. Never use New to allocate a cluster // because then the cluster won't own itself. operation ExtractDataFromTemporaryCluster(temporaryCluster : BlockCluster); // Initialize cluster's fields by extracting fields from // a temporary cluster. // This call is used by the flattener, to fill the fields // of a real cluster (self) from a temporary cluster (given as a parameter) // that was created only for the process of decoding #ifdef DEBUG overrides Copying; // Do not allow cluster copying. #endif attribute Active: Boolean, readOnly; // This always returns true. PackageCluster overrides this and provide a setter. // object operations operation AddObject(size: Unsigned; class: ClassNumber): Object, safe; // used by Object_New or _Copy operation RemoveObject(object: Object): Boolean, noFail; operation RemoveObjectNoUnshadow(object: Object): Boolean, noFail; operation OutOfMemoryRemoveObject(object: Object): Boolean, noFail; // used by Object_Destroy operation SetObjectLockedInCluster(object: Object; lock: Boolean); // used by LockReadExtra, etc. operation SetObjectSizeInCluster(object: Object; size: Unsigned; classInstalled :Boolean): Unsigned; // used by SetSize operation Each(function: EachFunction; parameters: Pointer): Object, noFail; // iterates through all objects in the cluster operation EachIncludingIndexicals(function: EachFunction; parameters: Pointer): Object, noFail; // iterates through all objects and indexicals in the cluster // also includes relocatable blocks without a class operation GetDefinedComponentNumbers(var definedComponents: ComponentRangeSet; includeLocators :Boolean; pristineRangeOnly: Boolean); // Accumulate all component numbers (not selectors, even if this is a ROM cluster) // defined by this cluster into the ComponentRangeSet, adding them to the ComponentRangeSet's // current contents, if any. // if includeLocators is false - don't add to the set locators (objects) defined in // the cluster. // cleaning operation CleanReferencesToUnattachedObjects(); // This operation cleans all references to objects that have been deleted // or freed during boot and are now replaced by a unattached locator. Typicaly, // these will be references to transient objects. // support bottleneck calls for FlatMoveNear operation AddReferenceToCluster(object: Object); // does everything AddObject does, except for allocating the object's block operation RemoveReferenceFromCluster(object: Object); // does everything RemoveObject does except for dealocating the object's data end class;