Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 Library:
Storage


NAME

Storage - storage allocation

SYNOPSIS

PROCEDURE ALLOCATE(VAR a: ADDRESS; n: CARDINAL);
PROCEDURE DEALLOCATE(VAR a: ADDRESS; n: CARDINAL);
PROCEDURE Setmode(m: CARDINAL);

DESCRIPTION

ALLOCATE allocates n bytes memory and returns a pointer a to this storage area.

DEALLOCATE frees n bytes allocated storage starting at address a and sets a to NIL.

Setmode switches the mode of reaction on storage overflow. If m equals 1 ALLOCATE causes the abortion of the program (default). M equal 2 causes ALLOCATE to return a NIL pointer. Note that Setmode should be used with care because all library modules assume that ALLOCATE was successful if it returns. Therefore, the mode 2 should be used temporarily only.

DIAGNOSTICS

ALLOCATE prints `No space available' to filedescriptor 2 in case of abortion (see SysPanic).
Edited by: borchert, last change: 1997/02/25, revision: 1.2, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine