Links are not active on this page.
 _FreeHand( ) API Library Routine

Releases a memory handle hand previously allocated by means such as _AllocHand( ).

void _FreeHand(MHANDLE hand)
MHANDLE hand;            /* Memory handle. */

Expand imageExample

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

 CopyCode imageCopy Code
SET LIBRARY TO FREEHAND

C Code

 CopyCode imageCopy 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
};

Expand imageSee Also