Local Memory: 2.1 Structure of a Local Memory Heap: The Local Heap

Up: GEOS SDK TechDocs | Up | Prev: 2 Structure of a Local Memory Heap | Next: 2.2 Chunks and Chunk Handles

An application may designate any block as a local memory heap. The block may or may not be fixed, swapable, or discardable, as the application desires.

A block may have other data besides the local heap. When a local heap is created, an offset into the block can be specified. The heap will put its header structure at the beginning of the block and the handle table at the specified offset; everything in between will be left untouched by the LMem routines. The offset must be larger than the standard header or else may be zero, indicating that the default offset should be used.

Before performing any operations on a local memory heap, an application must lock the heap the way it would any other block. Some local memory routines may need to resize the block; this may cause the block to be moved on the global heap. Therefore, you should assume that these routines may invalidate all pointers to the relevant block. The descriptions of routines which may behave this way will contain a warning to that effect. When you initialize an LMem heap, you can specify that it should never be resized; this is advisable if the heap is in a fixed block.

A virtual-memory file block may contain an LMem heap. For details on this, see the Virtual Memory chapter.


Up: GEOS SDK TechDocs | Up | Prev: 2 Structure of a Local Memory Heap | Next: 2.2 Chunks and Chunk Handles