how to allocate class without gc?

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 26 07:03:58 PST 2016


On Tuesday, 26 January 2016 at 13:56:39 UTC, Igor wrote:
> //ubyte[__traits(classInstanceSize, App)] buffer;
> auto buffer = 
> core.stdc.stdlib.malloc(__traits(classInstanceSize, 
> App))[0..__traits(classInstanceSize, App)];
>
> works, so it is the ubyte line.
> 		

Can you please post the full code? From your description, it 
looks like the stack frame might get invalidated...


More information about the Digitalmars-d-learn mailing list