On 12/04/2016 11:28 AM, Graeme Geldenhuys wrote:
> Hi,
> 
> If I use an array to hold a list of say Integers. Is there any serious
> performance penalty for resizing (growing) the dynamic array as I add
> items. My point being, I don't know the number of elements I'll need
> beforehand.
> 
The problem with enlarging big dynamic arrays is that AFAIK there always
is a move operation of the whole existing data. Libc realloc() on the
other hand only relocates the pointer of a virtual memory block if possible.

Martin
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to