FreeMem (procedure)


 FreeMem (procedure)

Disposes of a dynamic variable of a given size.


 procedure FreeMem(var P: Pointer; Size: Word);


Windows, Real, Protected


P is a variable of any pointer type previously assigned by the GetMem procedure or assigned a meaningful value by an assignment statement.

Size is an expression specifying the size in bytes of the dynamic variable to dispose of; it must be exactly the number of bytes previously allocated to that variable by GetMem.

FreeMem destroys the variable referenced by P and returns its memory region to the heap. If P does not point to a memory region in the heap, a run-time error occurs. After a call to FreeMem, the value of P becomes undefined, and an error occurs if you subsequently reference P^.


Should not be used with Mark or Release

See Also

Sample Code

Тэги: FreeMem
| G+
Код для вставки: :: :: :: ::
Поделиться: // //