Category : Modula II Source Code
Archive   : FM2LIB31.ZIP
Filename : STORAGE.DEF

 
Output of file : STORAGE.DEF contained in archive : FM2LIB31.ZIP

DEFINITION MODULE Storage;

(* (C) Copyright 1987,1988 Fitted Software Tools. All rights reserved. *)

(*
This module manages the Modula-2 heap which is defined to be all
the memory between System.HeapTop and System.MemTop.
The Storage procedures will keep System.HeapTop up to date as
the heap expands or shrinks.
*)

FROM SYSTEM IMPORT ADDRESS;


PROCEDURE ALLOCATE( VAR a :ADDRESS; size :CARDINAL );
(*
allocates size bytes in the heap and returns a pointer to
that memory block in a.
*)

PROCEDURE DEALLOCATE( VAR a :ADDRESS; size :CARDINAL );
(*
returns a previously allocated memory block of size size
to the heap.
*)

PROCEDURE Available( size :CARDINAL ) :BOOLEAN;
(*
TRUE if a memory block of size size is available for allocation
*)

END Storage.