2
0

ex41.pp 443 B

1234567891011121314151617
  1. Program Example41;
  2. { Program to demonstrate the MemAvail function. }
  3. Var
  4. P, PP : Pointer;
  5. begin
  6. GetMem (P,100);
  7. GetMem (PP,10000);
  8. FreeMem (P,100);
  9. { Due to the heap fragmentation introduced
  10. By the previous calls, the maximum amount of memory
  11. isn't equal to the maximum block size available. }
  12. Writeln ('Total heap available (Bytes) : ',MemAvail);
  13. Writeln ('Largest block available (Bytes) : ',MaxAvail);
  14. end.