Array Slices and Interior Pointers

Timon Gehr timon.gehr at gmx.ch
Mon Dec 10 17:49:03 PST 2012


On 12/11/2012 01:04 AM, Alex Rønne Petersen wrote:
> http://xtzgzorex.wordpress.com/2012/12/11/array-slices-and-interior-pointers/
>
>
> Destroy.
>

Why does the internal representation have to be the same for a managed 
port and native D? Also, how does the second representation work 
exactly? Not all slices extend to the end of the memory block.

I don't really feel strongly about the memory requirements for slices, 
but 12 / 24 bytes is starting to feel a little bulky. I am not 
intimately familiar with druntime, but OTOH and AFAICS, the additional 
pointer should also allow faster retrieval of the slice's capacity. 
(though the compiler should IMHO implement specific optimizations for ~= 
in loops anyway.)


More information about the Digitalmars-d mailing list