[fpc-devel] Memavail, Maxavail, Heapsize removed use GetHeapStatus instead

Peter Vreman peter at freepascal.org
Mon Nov 22 21:52:11 CET 2004


The following functions are removed:
  - MemAvail
  - MaxAvail
  - HeapSize

With the new heap manager the values that the functions returned are
invalid and can't be used to make any decisions whether there is enough
memory.

There is a new call added to replace the functionality:

procedure GetHeapStatus(var status:THeapStatus);

type
  THeapStatus = record
    MaxHeapSize,
    MaxHeapUsed,
    CurrHeapSize,
    CurrHeapUsed,
    CurrHeapFree  : ptrint;
  end;

This contains all the information about the Current memory sizes used by
the Heap and the Maximum values used by your program at some time.

For backwards compatibility, there is a symbol defined HASGETHEAPSTATUS.
When this symbol is defined you have to use GetHeapStatus(). This symbol
will stay in the compiler in 2.0.x series. After that release it shall be
replaced with a {$ifndef ver2}










More information about the fpc-devel mailing list