I've big problem with speed of my project, I made sample test with problem.
type
PStruct= ^TStruct;
TStruct=record
Size1: Integer;
Size2: Integer;
end;
var
Form1: TForm1;
st : PStruct;
pp : array of PStruct;
i: integer;
implementation
{$R *.lfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
SetLength(pp,600000);
for i:=0 to 600000 do begin
New(st);
st^.Size1:=-1;
st^.Size2:=-1;
pp[i]:=st;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
for i:=0 to 600000 do
Dispose(PStruct(pp[i]));
end;
The problem is with slow Dispose when I use cmem, with cmem dispose procedure is 10,15x slower then without cmem.
I need cmem in my project, can some one help with this ? ( I use Windows x64 and fpc,lazarus from trunk).