home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Modula / Source / STORAGE.DEF < prev   
Text File  |  1985-04-25  |  1KB  |  33 lines

  1. DEFINITION MODULE Storage;  (* to be used unchanged for MacIntosh by Franz Kronseder 30.01.85 *)
  2.  
  3. (*--------------------------
  4. This is the management module for the heap segment. The definitions are
  5. exactly the same as on SMAKY8.
  6. *************************************************************************)
  7.  
  8. FROM SYSTEM IMPORT ADDRESS;
  9.  
  10. EXPORT QUALIFIED
  11.   ALLOCATE, DEALLOCATE, Available, CreateHeap, DestroyHeap;
  12.  
  13. PROCEDURE ALLOCATE (VAR addr : ADDRESS; amount : CARDINAL);
  14.  (* allocates the requested amount of memory (in bytes) and returns the *)
  15.  (* starting address . HALT if the amount is not available              *)
  16.  
  17. PROCEDURE DEALLOCATE (VAR addr : ADDRESS; amount : CARDINAL);
  18.  (* deallocates the given amount of memory (in bytes). HALT if the *)
  19.  (* memory hasn't been allocated by ALLOCATE                       *)
  20.  
  21. PROCEDURE Available (amount : CARDINAL) : BOOLEAN;
  22.  (* returns TRUE if an ALLOCATE of the specified amount (in bytes) *)
  23.  (* of memory would be possible                                    *)
  24.  
  25. PROCEDURE CreateHeap (amount : CARDINAL);
  26.  (* has no function in the current implementation *)
  27.  
  28. PROCEDURE DestroyHeap;
  29.  (* has no function in the current implementation *)
  30.  
  31. END Storage.
  32.  
  33.