How to instantiate class object NOT in the GC heap

Alex Rønne Petersen alex at lycus.org
Sun Jul 15 09:40:43 PDT 2012


On 15-07-2012 18:34, 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.
>
> Bye,
> bearophile

malloc is guaranteed to allocate on a machine word boundary which I 
think is sufficient.

Bug-prone? Sure. But I don't think there's much we can do about that 
without language support...

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org




More information about the Digitalmars-d-learn mailing list