How to fix the mismatch struct size

Arjan arjan at ask.me.to
Mon May 16 07:29:39 UTC 2022


On Monday, 16 May 2022 at 05:57:33 UTC, test123 wrote:
> ```c
> typedef struct {
>   const char *str;
>   size_t      len : 30;
>   bool        initial : 1;
>   bool        final : 1;
> } VTermStringFragment;
>
> [...]
Without fully scrutinizing your code I suspect the issues you see 
are caused by:
- alignment
- struct context pointer

see:

https://dlang.org/spec/attribute.html#align
and
https://dlang.org/spec/attribute.html#static


More information about the Digitalmars-d mailing list