reinterpret array

Dominikus Dittes Scherkl via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 13 09:32:13 PST 2015


On Tuesday, 13 January 2015 at 17:12:42 UTC, Adam D. Ruppe wrote:
> On Tuesday, 13 January 2015 at 17:09:32 UTC, Dominikus Dittes 
> Scherkl wrote:
>> I assume taking a slice of a pointer uses the GC, so this 
>> cannot be @nogc, am I right?
>
> Nope, slicing never allocates, it just takes an address and 
> length.
>
> If you append to a slice or increase the length though, the GC 
> might reallocate it.

Cool. So I can make the above even @nogc ?
Great.


More information about the Digitalmars-d-learn mailing list