Allocating a wstring on the stack (no GC)?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Wed May 7 12:09:05 PDT 2014


Maxime Chevalier-Boisvert:

> 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).


> Thanks for your help Mr Bear.

You are welcome :-)

Bye,
bearophile


More information about the Digitalmars-d mailing list