On 08 May 2010, at 16:42, Vinzent Höfler wrote:
>> 1)
>> TheArray: array of ItemArray;
>> AnyItem: ItemOfArray;
>> [...]
>> for j:=0 to 1000 do begin
>> SetLength(TheArray,j+1);
>> TheArray[j]:=AnyItem;
>> end;
>> [...]
>
> About 1000 GetMem operations (and 1000 assignments which aren't ther
> 1)
> TheArray: array of ItemArray;
> AnyItem: ItemOfArray;
> [...]
> for j:=0 to 1000 do begin
>SetLength(TheArray,j+1);
>TheArray[j]:=AnyItem;
> end;
> [...]
About 1000 GetMem operations (and 1000 assignments which aren't there in the
code below, so I won't count them).
> Now h
Hello FPC-Pascal,
Saturday, May 8, 2010, 1:26:09 PM, you wrote:
>> But it is faster than inserting elements in a dynamic array (unless
>> reference counted ones) because it usually moves less amount of data
>> (4/8 bytes per element).
VH> Implementing a dynamic array via a list implementation whi