Share via


_FreeHand( ) (Rutina de biblioteca API)

Libera un controlador de memoria hand asignado anteriormente por métodos como _AllocHand( ).

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

Ejemplo

El siguiente ejemplo asigna 1024 bloques de memoria de 16384 bytes hasta alcanzar un total de 16 MB y libera cada bloque de memoria mediante _FreeHand( ) antes de asignar el siguiente.

Código Visual FoxPro

SET LIBRARY TO FREEHAND

Código C

#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
};

Vea también

_AllocHand( ) (Rutina de biblioteca API) | _GetHandSize( ) (Rutina de biblioteca API) | _HandToPtr( ) (Rutina de biblioteca API) | _HLock( ) (Rutina de biblioteca API) | _HUnLock( ) (Rutina de biblioteca API) | _MemAvail( ) (Rutina de biblioteca API) | _SetHandSize( ) (Rutina de biblioteca API)