_vunlock

Description

Unlocks a virtual memory block.

#include <vmemory.h>

void __far _vunlock( _vmhnd_t handle, int dirty );

handle Handle to previously allocated virtual memory block  
dirty Flag indicating whether block should be written out or discarded when swapping occurs  

Remarks

The _vunlock function unlocks a virtual memory block. The argument handle points to a virtual memory block previously allocated through a call to _vmalloc or _vrealloc and locked through a call to _vlock.

If multiple locks are held on the virtual memory block, the block's lock count is decremented by one. If the block's lock count goes to zero, the block can be swapped out by the virtual memory manager. The pointer returned by _vlock when the block was first locked then becomes invalid.

The dirty flag indicates whether the block should be written out or discarded when swapping occurs. It can have one of the following values:

Value Meaning

_VM_CLEAN Discard contents of block when swapping occurs
_VM_DIRTY Write contents of block to auxiliary memory when swapping occurs

Return Value

None.

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_vlock, _vlockcnt, _vmalloc

Example

See the example for _vlock.