Releases a memory handle hand previously allocated by means such as _AllocHand(В ).
|
---|
void _FreeHand(MHANDLE hand)
MHANDLE hand; /* Memory handle. */ |
Example
The following example allocates 1024 blocks of 16384-byte memory blocks, for a total of 16 MB, freeing each memory block using _FreeHand(В ) before allocating the next.
Visual FoxPro Code
В | Copy Code |
---|
SET LIBRARY TO FREEHAND |
C Code
В | Copy Code |
---|
#include <pro_ext.h>
void FAR Example(ParamBlk FAR *parm)
{
MHANDLE mh;
int i;
for (i = 0; i < 1024; i++)
{
if ((mh = _AllocHand(16384)) == 0)
{
_Error(182); // "Insufficient memory"
}
_FreeHand(mh);
}
}
FoxInfo myFoxInfo[] = {
{"ONLOAD", (FPFI) Example, CALLONLOAD, ""},
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
}; |
See Also