* Patch from Laco to limit growth of TFPList

git-svn-id: trunk@34462 -
This commit is contained in:
michael 2016-09-08 19:03:11 +00:00
parent c2fec2e819
commit b8b96f0c8c

View File

@ -175,10 +175,11 @@ var
IncSize : Longint; IncSize : Longint;
begin begin
if FCount < FCapacity then exit(self); if FCount < FCapacity then exit(self);
IncSize := 4; if FCapacity > 128*1024*1024 then IncSize := 16*1024*1024
if FCapacity > 3 then IncSize := IncSize + 4; else if FCapacity > 8*1024*1024 then IncSize := FCapacity shr 3
if FCapacity > 8 then IncSize := IncSize+8; else if FCapacity > 128 then IncSize := FCapacity shr 2
if FCapacity > 127 then Inc(IncSize, FCapacity shr 2); else if FCapacity > 8 then IncSize := 16
else IncSize := 4;
SetCapacity(FCapacity + IncSize); SetCapacity(FCapacity + IncSize);
Result := Self; Result := Self;
end; end;