GEOS SDK TechDocs
|
|
3.11 File-Access Synchronization
|
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:
VMFileHandle
of the file containing the source block.
VMBlockHandle
of the source block.
VMFileHandle
of the destination file (which may be the same as the source file).
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.
GEOS SDK TechDocs
|
|
3.11 File-Access Synchronization
|
4 VM Chains