Function BRK

Syntax

brk address => error

Arguments and values

address -- A non-negative integer.

error -- A fixnum.

Description

The function brk changes the location of the program break, which defines the end of the process's data segment (i.e., the program break is the first location after the end of the uninitialized data segment). Increasing the program break has the effect of allocating memory to the process; decreasing the break deallocates memory.

The function brk sets the end of the data segment to the value specified by address, when that value is reasonable, the system has enough memory, and the process does not exceed its maximum data size (see setrlimit).

On success, brk returns zero. On error, +enomem+ is returned.

Errors

+enomem+ Either address is invalid, or there is not enough memory to set the break to the desired value.