Navigation:  Reference > Functions By Category > Memory > Memory Allocation >

_pGrab()

Previous pageReturn to chapter overviewNext page

Allocate memory from the process heap.

 

Syntax:

 

_pGrab(<nBytes>) -> <hPointer>

_pGrab(<cSrc>, @<nGetSize>) -> <hPointer>

 

Parameters:

 

<nBytes>

Number of bytes to alloc. Memory will be filled with Chr(0)

 

<cSrc>

If a string is provided as the first parameter, this function will alloc (Len(<cSrc>)+1) bytes and copy the content of <cSrc> to the new created memory buffer.

 

<nGetSize>

If the first parameter is a string this parameter will retrieve the length of the provided string.Must be passed by reference.

 

Return Value:

Pointer of the new allocated memory buffer.

 

Remarks:

All the memory pointers allocated with _pGrab() must be released only with _pFree(), _pGrab() memory will be automatically released at the end of the instance.