MemFree Function |
Namespace: XSharp.RT
FUNCTION MemFree( ptrBuffer AS IntPtr ) AS WORD
public static ushort MemFree( IntPtr ptrBuffer )
Tip |
---|
This function allows the direct manipulation of a memory location and should be used with extreme care. |
Tip |
---|
The Static Memory Functions (MemAlloc, MemSet etc) are included for compatibility only.
In most cases the static memory blocks can (and should) be replaced with arrays of bytes. Many of the functions in the runtime that take memory blocks as parameter, such as the low level IO functions, now have overloads that take arrays of bytes as parameter. We recommend that you use these overloads, because their performance is somewhat better. |
1LOCAL ptrBuff AS PTR 2ptrBuff := MemAlloc(128) 3IF ptrBuff = NULL_PTR 4 ? "Allocation failed" 5ELSE 6 MemFree(ptrBuff) 7ENDIF