Virtual Memory: 2.4 VM Structure: VM File Attributes

Up: GEOS SDK TechDocs | Up | Prev: 2.3 Virtual Memory Blocks | Next: 3 Using Virtual Memory
VMAttributes

Each VM file has a set of attributes which determine how the VM Manager treats the file. These attributes are specified by a set of VMAttributes flags. When a VM file is created, all of these attributes are off; after a file has been created, you can change the attributes with VMSetAttributes() (see Changing VM File Attributes ). The following flags are available:

VMA_SYNC_UPDATE
Allow synchronous updates only. Instructs VM Manager to update the file only when you call un updating routine ( VMUpdate() , VMSave() , etc.). This attribute is off by default (indicating that the VM manager should feel free to update blocks whenever they are unlocked). You should set this attribute if the file might not be in a consistent state every time a block is unlocked.
VMA_BACKUP
Maintain a backup copy of all data. The file can then be restored to its last stored state. This is described above.
VMA_OBJECT_RELOC
Use the built-in object relocation routines. This attribute must be set if the VM file contains object blocks.
VMA_NOTIFY_DIRTY
If this attribute is set, the VM Manager will notify all threads which have the VM file open when the file changes from clean to dirty. It notifies threads by sending a MSG_META_VM_FILE_DIRTY to each process that has the file open. (This message is defined for MetaClass , so any object can handle it.)
VMA_NO_DISCARD_IF_IN_USE
If this attribute is set, the VM manager will not discard LMem blocks of type LMEM_TYPE_OBJ_BLOCK if OLMBH_inUseCount is non-zero. This attribute must be set if the file contains object blocks. If this attribute is set, each object block will be kept in memory as long as any thread is using an object in the block.
VMA_COMPACT_OBJ_BLOCK
If set, the VM manager will unrelocate generic-object blocks before writing them. It does this by calling CompactObjBlock() . This allows a VM file to contain generic object blocks.
VMA_SINGLE_THREAD_ACCESS
Set this if only a single thread will be accessing the file. This allows optimizations in VMLock() . This attribute must be set if the VM file contains object blocks.
VMA_OBJECT_ATTRS
This is not, strictly speaking, a VM attribute. Rather, it is a mask which combines the flags VMA_OBJECT_RELOC, VMA_NO_DISCARD_IF_IN_USE, and VMA_SINGLE_THREAD_ACCESS. All of these attributes must be set if the file contains object blocks.

Up: GEOS SDK TechDocs | Up | Prev: 2.3 Virtual Memory Blocks | Next: 3 Using Virtual Memory