|
| Previous: 3.5 MEMORY -- Dynamic Memory Management | TOC | Index | Back | Next: 3.5.2 ALLOC |
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 |