Allocating a wstring on the stack (no GC)?
Maxime Chevalier-Boisvert via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 7 12:18:08 PDT 2014
>> Is the slice going to be allocated on the stack? (I imagine
>> the answer is yes)
>
> Slicing doesn't change where the data is allocated. Slicing
> means just creating a new struct that contains a length and
> pointer to the data (and the struct itself is allocated
> in-place. So it's allocated on the stack, or inside a struct
> instance, or inside a class instance, or on the data segment,
> etc).
Indeed. It's the struct representing the slice I was asking
about. Off to test out the performance impact :)
More information about the Digitalmars-d
mailing list