Local Memory: 2 Structure of a Local Memory Heap

Up: GEOS SDK TechDocs | Up | Down | Prev: 1 Design Philosophy | Next: 3 Using Local Memory Heaps

A local memory heap looks and acts much like the global heap. However, it is contained entirely within a single memory block. This block is initialized with a 16-byte LMemBlockHeader (described on The offset within the block where the local heap's handle table will begin. The local heap will fill the space to the end of the block; any data between the LMemBlockHeader and the indicated offset will be zero-initialized. If an application wil ), a local memory handle table, and a local memory heap. Optionally, a space for data may be allocated between the header and the handle table.

Each allocated section of memory within a local heap is called a chunk , and the handles of these chunks are called chunk handles .

Chunks comprise a chunk of data preceded by a word that contains the length of the data (in bytes). When the heap is created, a certain number of chunk handles will be allocated. If a chunk is requested after all of these chunks have been given out, the local memory routines will enlarge the LMem handle table, relocating chunks as necessary. Unused chunks are stored in a linked list.


Up: GEOS SDK TechDocs | Up | Down | Prev: 1 Design Philosophy | Next: 3 Using Local Memory Heaps