XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

expand


Type:   -   function (subr)
Source:   -   xlsys.c, xldmem.c

Syntax

(expand segments)
segments - the number of segments to add as an integer expression
returns - the number of segments added

Description

The 'expand' function expands memory by the specified number of 'segments'. The number of 'segments' added is returned as the result. The power up default is 1000 nodes per segment. Note that alloc allows you to change the number of nodes per segment.

Examples

(room)      ; prints  Nodes:       8000
            ;         Free nodes:  5622
            ;         Segments:    6
            ;         Allocate:    1000
            ;         Total:       92586
            ;         Collections: 8
            ; returns NIL

(expand 2)  ; add more nodes

(room)      ; prints  Nodes:       10000
            ;         Free nodes:  7608
            ;         Segments:    8
            ;         Allocate:    1000
            ;         Total:       112602
            ;         Collections: 8
            ; returns NIL

Note: When gc is called or an automatic garbage collection occurs, if the amount of free memory is still low after the garbage collection, the system attempts to add more segments [an automatic 'expand'].

See the expand function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next