Per-VDM Data Allocation

Handle table entries, register sets, save tables, and handle names all require a good deal of space if used fully. Most of these data structures typically do not require their maximum possible size. For this reason, they are allocated dynamically by VEMM in order to reduce memory utilization.

Memory for a register set is allocated when clients allocate the register set. An array of 16 pointers will address buffers for allocated register sets; these pointers are null for free register sets that applications may yet allocate.

The handle table, handle name table, and save tables are all allocated with a directory structure. A directory is an array of pointers to allocation blocks; each allocation block contains enough space for multiple entries. This allows a specific entry to be found by specifying the block and entry offset within the block. Since each can have at most 255 entries, both the block and offset can fit in a single byte.

An allocated handle entry contains an index for its associated save table or name (if used). For unallocated objects, the index is zero. The smallest free handle will be allocated when a handle is needed, thus requiring less memory to be allocated for the handle table.

The name table is kept in packed form. When an entry is freed, the last entry is moved into the free hd, thus reducing space requirements.

Save table entries are larger and generally have short lifetimes. These will be allocated in the same way handles are allocated (that is, where the smallest available is allocated first). For all three of these tables, when new entries are needed and all blocks are full, a new block is allocated.


[Back: EMS Object Mapping]
[Next: Problems with Expanded Memory]