-- AllocDefs.mesa Edited by Sandman on June 30, 1980  4:42 PM
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  AltoDefs USING [PageCount, PageNumber],
  SegmentDefs USING [
    AllocInfo, EasyDown, EasyUp, DataSegmentHandle, FileSegmentHandle,
    SegmentHandle];

AllocDefs: DEFINITIONS =
  BEGIN OPEN AltoDefs, SegmentDefs;

  AllocInfo: TYPE = SegmentDefs.AllocInfo;

  -- Lower Level Segments Allocation


  MakeDataSegment: PROCEDURE [
    base: PageNumber, pages: PageCount, info: AllocInfo ← EasyDown]
    RETURNS [seg: DataSegmentHandle];

  MakeSwappedIn: PROCEDURE [
    seg: FileSegmentHandle, base: PageNumber, info: AllocInfo ← EasyUp];

  DefaultDataSegmentInfo: AllocInfo = EasyDown;
  DefaultFileSegmentInfo: AllocInfo = EasyUp;

  -- Swap Strategies and Swapping Procedures: 

  SwappingProcedure: TYPE = PROCEDURE [
    needed: PageCount, info: AllocInfo, seg: SegmentHandle] RETURNS [BOOLEAN];

  SwapStrategy: TYPE = RECORD [
    link: POINTER TO SwapStrategy, proc: SwappingProcedure];

  TryCodeSwapping, CantSwap: SwappingProcedure;
  AddSwapStrategy: PROCEDURE [strategy: POINTER TO SwapStrategy];
  RemoveSwapStrategy: PROCEDURE [strategy: POINTER TO SwapStrategy];

  END..