mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 03:29:41 +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;
|
||||
begin
|
||||
if FCount < FCapacity then exit(self);
|
||||
IncSize := 4;
|
||||
if FCapacity > 3 then IncSize := IncSize + 4;
|
||||
if FCapacity > 8 then IncSize := IncSize+8;
|
||||
if FCapacity > 127 then Inc(IncSize, FCapacity shr 2);
|
||||
if FCapacity > 128*1024*1024 then IncSize := 16*1024*1024
|
||||
else if FCapacity > 8*1024*1024 then IncSize := FCapacity shr 3
|
||||
else if FCapacity > 128 then IncSize := FCapacity shr 2
|
||||
else if FCapacity > 8 then IncSize := 16
|
||||
else IncSize := 4;
|
||||
SetCapacity(FCapacity + IncSize);
|
||||
Result := Self;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user