Hi,

Should I (and in which case) call Finalize() when using FillChar/FillByte?
Heaptrc unit is not detecting any memory leak. For example:

type
  PMyRec = ^TMyRec;
  TMyRec = record
    Field1: Int64;
    Field2: String;
    Field3: Int64;
    Field4: String;
    Field5: Boolean;
  end;

procedure push(ARec: PMyRec);
begin
  writeln(ARec^.Field2,',', ARec^.Field4);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  FillChar(f, SizeOf(TMyRec), 0);
  f.Field1 := 1;
  f.Field2 := 'abc';
  push(@f);
  FillChar(f, SizeOf(TMyRec), 0);
  f.Field1 := 2;
  f.Field2 := 'vbnj';
  push(@f);
end;

Regards
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to