home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
375.lha
/
IncrStorageManager_v1.0
/
Storage.mod
< prev
next >
Wrap
Text File
|
1990-05-02
|
781b
|
30 lines
IMPLEMENTATION MODULE Storage;
FROM SYSTEM IMPORT ADDRESS, NULL;
IMPORT Memory;
PROCEDURE ALLOCATE(VAR addr: ADDRESS; amount: LONGCARD);
(* allocate a portion of memory - return 0 if no memory available.
addr: returns where the memory portion was allocated, word aligned.
amount: the number of bytes to allocate, will be a word multiple. *)
BEGIN
addr := Memory.AllocMem(amount, Memory.MemReqSet{Memory.MemClear});
IF addr = NULL
THEN
addr := NIL;
END;
END ALLOCATE;
PROCEDURE DEALLOCATE(VAR addr: ADDRESS; amount: LONGCARD);
(* return a portion of memory to the heap.
addr: the portion of memory returned by ALLOCATE.
amount: the size of the block given to ALLOCATE. *)
BEGIN
Memory.FreeMem(addr, amount);
END DEALLOCATE;
END Storage.