Change representation of dynamic arrays?

Janice Caron caron800 at googlemail.com
Sat Oct 20 00:20:12 PDT 2007


On 10/20/07, Walter Bright <newshound1 at digitalmars.com> wrote:

> 2) Doesn't break array.length as rvalue, as this is rewritten by the
> compiler as (array.end - array.start).

That's pointer arithmetic, of course, so looked at in pure assembler
terms, we're talking ((array.end - array.start) / element.sizeof)

Is there any performance cost to the divide, or is optimised to be a
right shift (at least where it can be)?



More information about the Digitalmars-d mailing list