"Andrei Alexandrescu" <[email protected]> wrote in message news:[email protected]...
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 :)

In fact, this is what .NET does as well, if I'm not mistaken. But then, .NET always has an extra indirection because of the movable GC stuff, right?

L.

Reply via email to