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

_xGrab()

Previous pageReturn to chapter overviewNext page

Allocate memory from the ot4xb common heap.

 

Syntax:

 

_xGrab(<nBytes>) -> <hPointer>

_xGrab(<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 _xGrab() must be released only with _xFree(), _xGrab() memory will be automatically released at the end of the instance. _xGrab() is the preferred method to allocate memory.