[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
_xvheapresize()
Resize a segment heap
------------------------------------------------------------------------------
C Prototype
#include "vm.api"
HANDLE _xvheapresize(
HANDLE hSegment,
USHORT uiSize
)
Arguments
hSegment is the VM segment handle returned by _xvheapnew().
uiSize is the new size in bytes.
Returns
If successful, _xvheapresize() returns the original VM segment handle;
otherwise, it returns zero.
Description
_xvheapresize() resizes a previously allocated segment heap, shortening
or lengthening the segment heap to match the specified size. If you
shorten the segment heap, bytes at the end of the segment are lost.
If the resizing is unsuccessful (indicated by a return value of zero),
the segment heap retains its original size.
Warning! Do not use _xvheapresize() to resize a segment heap that
has any allocated memory block locked. Unlock the memory block first
using _xvheapunlock().
Examples
. This example resizes a segment heap:
// CA-Clipper include files
#include "extend.api"
#include "vm.api"
// Prototype
Boolean HeapResize(HANDLE hSegment, unsigned uiNewSize);
Boolean HeapResize(HANDLE hSegment, unsigned uiNewSize)
{
Boolean bResult = FALSE;
// Don't attempt to resize locked segment
//
if (_xvlockcount(hSegment) == 0)
{
if (_xvheapresize(hSegment, uiNewSize))
bResult = TRUE;
}
return (bResult);
}
Files Library is CLIPPER.LIB, header file is Vm.api.
See Also:
_xvheapnew()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson