RFC on range design for D2

bearophile bearophileHUGS at lycos.com
Thu Sep 11 11:03:58 PDT 2008


Sean Kelly:
> I'd think that adding a capacity field should actually speed up append 
> operations, since the GC wouldn't have to be queried to determine this 
> info.

Yes, but I meant slower than just adding the capacity field without adding such extra bit flag to tell apart slices from arrays.


> And as in another thread, the capacity of all slices should 
> either be zero or the size of the slice, thus forcing a realloc for any 
> append op.

Oh, right, no need to a separate bit for tagging then, is the value capacity=0 that's the tag.
Do D designers like this (small) change in the language? :-)

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list