Share via


Memory Management Routines

These API routines allow you to manipulate and allocate memory for your API functions.

_Alloca( )

Allocates a block of stack space for the calling routine. Memory is automatically freed when the routine exits.

_AllocHand( )

Returns a new MHANDLE of size hsize. A value of zero is returned when there is insufficient memory to fulfill the request. Memory allocated with _AllocHand( ) isn't initialized.

_FreeHand( )

Releases an MHANDLE previously allocated by means such as _AllocHand( ).

_GetHandSize( )

Returns the usable number of bytes associated with an MHANDLE.

_HandToPtr( )

Translates an MHANDLE to a FAR (32-bit) pointer, which points to the memory allocated to this MHANDLE.

_HLock( )

Locks an MHANDLE to prevent it from moving if Visual FoxPro requires memory reorganization.

_HUnLock( )

Unlocks an MHANDLE, allowing it to participate in Visual FoxPro memory reorganization.

_MemAvail( )

Returns True if a request to allocate a handle of size bytes will succeed. Otherwise, _MemAvail( ) returns False.

_MemCmp( )

Compares two length byte memory areas.

_MemFill( )

Fills an area of memory starting at the location pointed to by ptr with length copies of the byte in character.

_MemMove( )

Copies length bytes from src to dest.

_SetHandSize( )

Changes the amount of memory allocated to an MHANDLE. The routine returns True if the reallocation is successful or False if the reallocation fails.