Alligned gc allocation of struct

Sjoerd Nijboer dlang at sjoerdnijboer.com
Fri Oct 5 09:36:41 UTC 2018


I've got a `struct Foo{ubyte16 field1, field2.... fieldn;}` for 
which I would like a heap allocation `Foo* foo = new Foo();` But 
the fields itsself must be 16 bytes aligned for SIMD instructions.
Is there a neat way to do this in D?
As far as I can tell the GC_allocator doesn't do aligned 
allocations by default.


More information about the Digitalmars-d-learn mailing list