[comp.sys.atari.st] Bug in OSS Pascal memavail function

terrell@OHIO-STATE.ARPA.UUCP (03/21/87)

There's an interesting problem with the OSS Pascal memavail function.

The value returned by this function does not increase after the dispose
procedure has returned some memory to the dynamic heap.  The value
only changes (decreases) following a call to the new procedure, or when
the os allocates some memory.

When I first noticed this, I assumed that dispose simply didn't return
memory to the heap.  In fact it does, but the value returned by memavail
does not reflect this.

To ascertain that dispose does in fact return memory to the heap, I wrote
a test program that repeatedly allocates and frees memory.  It worked fine.

The solution to this problem is, I suppose, to keep track of available
memory manually when using the dynamic heap.

Terrell