t3x.org / t3x / t3x-manual / 351.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
3.5 MEMORY -- Dynamic Memory Management
TOC | Index | Back Next:
3.5.2 ALLOC

3.5.1 MEMORY Class Usage

OBJECT MEM[MEMORY];

The MEMORY class implements dynamic memory pools. When initialized, the address of a static data area is passed to a MEMORY object. This area (called a 'pool') will be managed by the MEMORY object. Vectors can be allocated from the pool and released to it when they are no longer required.

A first-match algorithm is used to allocate memory in a pool. The algorithm is optimized for sequential allocation. The pool is defragmented when releasing memory, but no garbage collection is performed.

MEMORY objects are ineffective when allocating a large number of small vectors, since a free list entry has to be created for each vector allocated.

Multiple memory pools may be defined using the MEMORY class.

Previous:
3.5 MEMORY -- Dynamic Memory Management
TOC | Index | Back Next:
3.5.2 ALLOC