[fpc-pascal] ptop and comma.

fredvs fiens at hotmail.com
Mon Feb 24 13:14:04 CET 2020


Hello Bart.

OK, I did try your idea, changing the original code with this (see 2 last
lines):

procedure TPToP.Usage(ECode: word);
begin
  writeLn('ptop : Usage : ');
  writeLn('ptop [-v] [-i indent] [-b bufsize ][-c optsfile][-l linesize]
infile outfile');
  writeLn('     converts infile to outfile.');
  writeLn('     -c : read options from optsfile');
  writeLn('     -i : Set number of indent spaces.');
  writeLn('     -l : Set maximum output linesize.');
  writeLn('     -b : Use buffers of size bufsize');
  writeLn('     -v : be verbose');
  writeLn('ptop -g ofile');
  writeLn('     generate default options file');
  writeLn('ptop -h : This help');
  ExitCode := ECode; // this change instead of halt(ECode);
  Terminate;               // this change instead of halt(ECode);
end;

Is it what you are thinking?
Indeed, no more memory leak and error preserved with this.

Heap dump by heaptrc unit of ptop
29 memory blocks allocated : 2242/2280
29 memory blocks freed     : 2242/2280
0 unfreed memory blocks : 0
True heap size : 131072
True free heap : 131072

Fre;D




-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/


More information about the fpc-pascal mailing list