Russell Whitaker wrote:
Got the following from "Borland Pascal with Objects - Language Guide"
function MaxAvail "Returns the size of the largest contiguous free block in the heap, indicating the size of the largest dynamic varible that can be allocated at the time of the call to MaxAvail."
function MemAvail "Returns the number of free bytes of heap storage available."
Also on another page there is a blurb on how to make New and GetMem return nil instead of aborting the program.
These are typical Borland kludges, that don't and can't port to modern systems with virtual memory. New has to adhere to standard specifications, the other three are extension and can be constructed to do anything.
For example, under Windoze or *ix the action of new is likely to depend on a C malloc implementation (whose action is predetermined) and which is in turn very likely to depend on the system provided sbrk. Ultimately new/malloc failure depends on sbrk failure.
Yes, all those objections can be beaten, on a particular system. But one of the objectives of Pascal is portability. That is why we have standards such as ISO7185 and ISO10206, and why failure to observe them is very poor practice.