Lionello Lunesu wrote:
"Andrei Alexandrescu" <seewebsiteforem...@erdani.org> wrote in message
news:h5ndt0$1bl...@digitalmars.com...
bearophile wrote:
Walter Bright:
Under the hood, a T[new] will be a single pointer to a library
defined type. This library defined type will likely contain three
properties:
I have another question: are there some performance penalities in
using such arrays for normal random access operations?
One extra indirection, usually nearby.
Andrei
If the size and capacity get added to the begining of the memory block
containing the data, only an extra offset is needed. The compiler could
emit "mov eax, [esi*4 + 8]" or something. Look ma, no extra indirection :)
I wish too. The problem is that when you resize the array, the control
block will not refer to the adjacent chunk.
Andrei