Overview: 6.3 System Services: Local Memory and Object Blocks

Up: GEOS SDK TechDocs | Up | Prev: 6.2 Virtual Memory | Next: 6.4 Item Databases

Often applications will want to store large numbers of very small data items. In these cases, it's cumbersome and inefficient to allocate a global handle and a block on the global heap. For these situations, GEOS offers the concept of local memory (LMem).

Local memory can be thought of as a mini-heap within a memory block. Each individual unit allocated in this mini-heap is known as a chunk , and each chunk is designated a chunk handle . Thus, to access any piece of information within an LMem block, you need to have the block's global handle and the item's chunk handle.

Chunks may be allocated or freed, and any chunk may be moved within an LMem heap at any time (e.g. when the LMem heap is compacted). Locked LMem heaps may have chunks shuffled only when space is allocated within the heap. Access to chunks is gained by locking the LMem block and dereferencing the chunk handle. Chunks may be resized, and bytes may be added to or removed from chunks.

LMem blocks are used primarily for two purposes: Database files and object blocks. Database files are managed by the Item Database Library (see below). Object blocks are used extensively by the UI and applications; object blocks store objects in memory and often are attached to VM files.

Each object in an object block occupies one chunk. Thus, the combination of global handle and chunk handle of an object is known as the Object Pointer (optr) of the object. The optr is used to identify the object uniquely in the system for all types of access.


Up: GEOS SDK TechDocs | Up | Prev: 6.2 Virtual Memory | Next: 6.4 Item Databases