There is *NO* abi stability in -head
David Chisnall
theraven at FreeBSD.org
Tue Oct 24 08:19:06 UTC 2017
On 23 Oct 2017, at 21:35, Mateusz Guzik <mjguzik at gmail.com> wrote:
>
> Instead, the same can be reshuffled:
> struct crap2 {
> int i1;
> int i2;
> void *p1;
> void *p2;
> };
>
> With offsets:
>
> 0x1000 i1
> 0x1004 i2
> 0x1008 p1
> 0x1010 p2
>
> This is only 24 bytes. 2 ints can be placed together and since they add
> up to 8 the p1 pointer gets the right alignment without extra padding.
If you are making changes of this nature, please consider sorting in the other order. When we start seeing 128-bit pointers (which, with CHERI-like systems, may be sooner than you think) then this ordering will give you lots of padding, whereas putting the pointers first will not.
David
More information about the freebsd-current
mailing list