On 23 Oct 2017, at 21:35, Mateusz Guzik <mjgu...@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.


freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to