Previous: Frac function To the Table of Content Next: GetDir procedure

- 4.62.2.33 -
Standard Units
System Unit
System Unit Procedures and Functions

FreeMem procedure

Targets: MS-DOS, OS/2, Win32


System Unit

Disposes of a dynamic variable of a given size.

Declaration:
procedure FreeMem(var  P: Pointer; Size: Longint);
Remarks:
P points to any type variable that was previously assigned either by calling GetMem or by an assignment. FreeMem returns the allocated memory, pointed to by P, back to heap. Size must match the size of the variable that was allocated by GetMem. If P does not reference heap, a run time error occurs.

An error occurs if FreeMem is called to de-allocate a variable with the wrong size. This is particularly useful while debugging. References to P^ after a call to FreeMem result in undefined data.


Previous: Frac function To the Table of Content Next: GetDir procedure
Frac function Table of Content GetDir procedure

- 4.62.2.33 -