fork download
  1. program ideone;
  2. uses heaptrc;
  3. type
  4. TMyStruct = record
  5. a,b: integer;
  6. end;
  7. PMyStruct = ^TMyStruct;
  8.  
  9. var
  10. p : PMyStruct;
  11. begin
  12. heaptrc.SetHeapTraceOutput(output);
  13. p := GetMem(sizeof(TMyStruct));
  14. p^.a := 5;
  15. writeln(p^.a);
  16. FreeMem(p);
  17. end.
Success #stdin #stdout 0s 5468KB
stdin
Standard input is empty
stdout
5
Heap dump by heaptrc unit
1 memory blocks allocated : 4/8
1 memory blocks freed     : 4/8
0 unfreed memory blocks : 0
True heap size : 32768
True free heap : 32768