mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-11 18:30:45 +01:00
* Clear memory correctly when setting capacity (bug id 28928)
git-svn-id: trunk@32327 -
This commit is contained in:
parent
e6b86d9b5b
commit
d00d64021b
@ -1129,7 +1129,7 @@ begin
|
||||
If Index<FCount then
|
||||
System.Move (FList^[Index],FList^[Index+1],
|
||||
(FCount-Index)*SizeOf(TStringItem));
|
||||
Pointer(Flist^[Index].Fstring):=Nil; // Needed to initialize...
|
||||
// Pointer(Flist^[Index].Fstring):=Nil; // Needed to initialize...
|
||||
Flist^[Index].FString:=S;
|
||||
Flist^[Index].FObject:=O;
|
||||
Inc(FCount);
|
||||
@ -1251,7 +1251,7 @@ begin
|
||||
begin
|
||||
MSize:=FCapacity*Sizeof(TStringItem);
|
||||
System.Move (FList^,NewList^,MSize);
|
||||
FillWord (Pchar(NewList)[MSize],(NewCapacity-FCapacity)*WordRatio, 0);
|
||||
FillWord (Pchar(NewList)[MSize],(NewCapacity-FCapacity)*(SizeOf(TStringItem) div SizeOf(Word)), 0);
|
||||
FreeMem (Flist,MSize);
|
||||
end;
|
||||
Flist:=NewList;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user