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.
(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