-- Zone.mesa (last edited by: McJones on: January 8, 1981 1:29 PM)
DIRECTORY
Environment USING [Base];
Zone: DEFINITIONS =
BEGIN
-- Types known by clients of the zone allocator
Alignment: TYPE = {a1, a2, a4, a8, a16};
Base: TYPE = Environment.Base; -- for upward compatibility
Handle: TYPE = PRIVATE RECORD[LONG UNSPECIFIED];
SegmentHandle: TYPE = PRIVATE RECORD[UNSPECIFIED];
BlockSize: TYPE = CARDINAL [0..77777B--largest block is 215-1 words--];
-- Useful constants
minimumNodeSize: READONLY BlockSize;
nullSegment: READONLY SegmentHandle;
nil: READONLY Base RELATIVE POINTER;
-- Status returned by Zone operations
Status: TYPE = {okay, noRoomInZone, nonEmptySegment, storageOutOfRange, zoneTooSmall, segmentTooSmall, invalidNode, invalidZone, invalidSegment, nodeLoop, wrongSeal, wrongVersion};
-- Node allocation and deallocation
MakeNode: PROCEDURE [zH: Handle, n: BlockSize, alignment: Alignment ← a1] RETURNS [node: Base RELATIVE POINTER, s: Status];
FreeNode: PROCEDURE [zH: Handle, p: LONG POINTER] RETURNS [s: Status];
SplitNode: PROCEDURE [zH: Handle, p: LONG POINTER, n: BlockSize] RETURNS [s: Status];
NodeSize: PROCEDURE [p: LONG POINTER] RETURNS [n: BlockSize];
-- Zone and segment management
Create: PROCEDURE [storage: LONG POINTER, length: BlockSize, zoneBase: Base, threshold: BlockSize ← minimumNodeSize, checking: BOOLEAN ← FALSE] RETURNS [zH: Handle, s: Status];
AddSegment: PROCEDURE [zH: Handle, storage: LONG POINTER, length: BlockSize] RETURNS [sH: SegmentHandle, s: Status];
RemoveSegment: PROCEDURE [zH: Handle, sH: SegmentHandle] RETURNS [storage: LONG POINTER, s: Status];
Recreate: PROCEDURE [storage: LONG POINTER, zoneBase: Base] RETURNS [zH: Handle, rootNode: Base RELATIVE POINTER, s: Status];
-- Zone and segment attributes
GetAttributes: PROCEDURE [zH: Handle] RETURNS [zoneBase: Base, threshold: BlockSize, checking: BOOLEAN, storage: LONG POINTER, length: BlockSize, next: SegmentHandle];
SetChecking: PROCEDURE [zH: Handle, checking: BOOLEAN] RETURNS [s: Status];
GetSegmentAttributes: PROCEDURE [zH: Handle, sH: SegmentHandle] RETURNS [storage: LONG POINTER, length: BlockSize, next: SegmentHandle];
GetRootNode: PROCEDURE [zH: Handle] RETURNS [node: Base RELATIVE POINTER];
SetRootNode: PROCEDURE [zH: Handle, node: Base RELATIVE POINTER];
END.
LOG
Time: February 21, 1979 10:50 AMBy: LauerAction: Created file
Time: July 18, 1979 4:19 PMBy: KnutsenAction: Added alignment parameter to MakeNode
Time: January 8, 1981 1:29 PMBy: McJonesAction: Added Recreate and RootNode procedures