-- File: DynamicZone.mesa
-- Last edited by Levin:   5-Oct-80 17:13:59

  AltoDefs USING [PageCount];

DynamicZone: DEFINITIONS =


  PageCount: TYPE = AltoDefs.PageCount;

  InitializeZones: PROCEDURE;
  -- must be called before any other procedures in this interface.

  FinalizeZones: PROCEDURE;
  -- caled to clean up zone allocator.  Note:  it is the client's responsibility
  -- to destroy any zones previously created with CreateZone.

  CreateZone: PROCEDURE [initialPages: PageCount ← 1, id: STRING ← NIL]
    RETURNS [MDSZone];
  -- creates a new zone whose allocation behavior is determined by 'initialPages'.
  -- 'id' is for assistance in debugging.

  TooManyZones: ERROR;
  -- raised by CreateZone if the requested zone cannot be created.

  -- returns the shared system zone.

  DestroyZone: PROCEDURE [zone: MDSZone];
  -- unconditionally destroys the zone.  It is the client's responsibility to ensure
  -- that no dangling pointers remain.

  PruneZone: PROCEDURE [zone: MDSZone];
  -- attempts to eliminate excessive space allocated to the zone.