mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 18:29:09 +02:00
* Patch from Laco to limit growth of TFPList
git-svn-id: trunk@34462 -
This commit is contained in:
parent
c2fec2e819
commit
b8b96f0c8c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user