How to instantiate class object NOT in the GC heap
Jonathan M Davis
jmdavisProg at gmx.com
Sun Jul 15 12:06:47 PDT 2012
On Sunday, July 15, 2012 18:34:44 bearophile wrote:
> Alex Rønne Petersen:
> > This is how you do it in modern D:
> This seems fiddly and bug-prone (and eventually fit to go in the
> D FAQ).
> Maybe it needs to use an aligned_malloc, to avoid aligning
> troubles in the class.
It'll probably become easier to do once we have allocators, since it'll
probably become possible to do something like
auto alloc = getMallocAllator();
auto obj = alloc.make!T(args1, args2, args3);
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list