Virtual Memory: 3.12 Using Virtual Memory: Other VM Utilities

Up: GEOS SDK TechDocs | Up | Prev: 3.11 File-Access Synchronization | Next: 4 VM Chains
VMCopyVMBlock(), VMSetReloc()

If you would like to duplicate a VM block, or copy it to another file, call VMCopyVMBlock() . This routine is passed three arguments:

The routine makes a complete duplicate of the source block, copying it to the destination file. It returns the VMBlockHandle of the duplicate block. Note that the duplicate block will almost certainly have a different block handle than the source block. If the block contains a copy of its own handle, you should update it accordingly.

Sometimes you will need to perform special actions whenever loading a block into memory or writing it to the disk. For example, you may store data in a compressed format on the disk, and need to expand it when it's loaded into memory. For this reason, you can set a relocation routine. This routine will be called whenever the following situations occur:

Using the routine VMSetReloc() , you can instruct the VM manager to call your relocation routine whenever appropriate.


Up: GEOS SDK TechDocs | Up | Prev: 3.11 File-Access Synchronization | Next: 4 VM Chains