XLISP alloc

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# alloc

Type: | - | function (subr)
Source: | - | xldmem.c

## Syntax

(alloc size)
  size - the number of nodes to allocate as an integer
  returns - the old number of nodes to allocate

## Description

The 'alloc' function changes the number of memory nodes allocated per segment whenever memory is expanded. The previous number of nodes allocated per segment is the value returned as the result. The power-up default is 1000 nodes per segment. Note that 'alloc' does not, itself, expand memory. You need to call the expand function to do the expand operation.

## Examples

    > (room)
    Nodes:       4000
    Free nodes:  1669
    Segments:    4
    Allocate:    1000    ; default ALLOC value
    Total:       52570
    Collections: 8
    NIL

    > (alloc 2000)       ; new ALLOC value
    1000                 ; old ALLOC value

    > (room)
    Nodes:       4000
    Free nodes:  1655
    Segments:    4
    Allocate:    2000    ; new ALLOC value
    Total:       52570
    Collections: 8
    NIL

See room.

See also:

- Contents → System Functions

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference