Why dynamic arrays in a struct crash when they are effectively at 8 byte align, but precceeded with align(1)?
kinke
noone at nowhere.com
Wed Oct 14 12:49:39 UTC 2026
On Wednesday, 14 October 2026 at 12:04:12 UTC, realhet wrote:
> The struct's footprint is the same, yet it requires default
> align: or align(n) at least 8.
> Are there any official requirements for these fap pointers?
> (Win32 64bit LDC)
You're hitting https://github.com/ldc-developers/ldc/issues/4236
here, which might get fixed soon (TurkeyMan is currently working
on it).
Note that while the offset of `subNodes` is 8 in both cases (no
need for `dummy`), that doesn't mean that the alignment is 8 -
because the alignment of the `WorkorderNode` struct is 4 in the
2nd case (the maximum of all field alignments).
More information about the Digitalmars-d-learn
mailing list