HeapTest.Mod 677 B

1234567891011121314151617181920212223
  1. MODULE HeapTest;
  2. IMPORT Machine, Commands;
  3. PROCEDURE Alloc *;
  4. VAR
  5. dummy: POINTER TO ARRAY OF CHAR;
  6. BEGIN
  7. NEW(dummy, 1024)
  8. END Alloc;
  9. PROCEDURE Free * (context: Commands.Context);
  10. VAR
  11. total, low, high: LONGINT;
  12. BEGIN
  13. Machine.GetFreeK(total, low, high);
  14. context.out.String("Free memory:");
  15. context.out.Ln;
  16. context.out.String(" total: "); context.out.Int(total, 0); context.out.String(" kB"); context.out.Ln;
  17. context.out.String(" low: "); context.out.Int(low, 0); context.out.String(" kB"); context.out.Ln;
  18. context.out.String(" high: "); context.out.Int(high, 0); context.out.String(" kB"); context.out.Ln;
  19. context.out.Update
  20. END Free;
  21. END HeapTest.