Why dynamic arrays in a struct crash when they are effectively at 8 byte align, but precceeded with align(1)?
realhet
real_het at hotmail.com
Wed Oct 14 12:04:12 UTC 2026
Hi,
Good:
```d
struct WorkorderNode[]
align(1):
ThingId thingId;
bool opened; ubyte[3] dummy;
align(8):
WorkorderNode[] subNodes;
```
Bad:
```d
struct WorkorderNode[]
align(1):
ThingId thingId;
bool opened; ubyte[3] dummy;
align(4/*!!!!!!!!!!*/):
WorkorderNode[] subNodes;
```
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)
More information about the Digitalmars-d-learn
mailing list