Re: Micro optimizations welcome?

2016-09-17 Thread Giulio Camuffo
2016-09-18 4:03 GMT+03:00 Yong Bakos : > On Sep 17, 2016, at 5:42 PM, Ursache Vladimir wrote: >> >> Hi, >> On amd64 struct wl_display from wayland-client.c can shrink in size >> from 320 bytes to 304 if two fields (last_error and id) are >> rearranged.

Re: Micro optimizations welcome?

2016-09-17 Thread Ursache Vladimir
I didn't try an ABI check (ever), I just spotted the padding while browsing the source code out of curiosity. As to struct protocol_error (from inside struct wl_display) I moved the "id" field to avoid compiler padding: from: uint32_t pointer uint32_t to: uint32_t uint32_t pointer On Sun,

Re: Micro optimizations welcome?

2016-09-17 Thread Yong Bakos
On Sep 17, 2016, at 5:42 PM, Ursache Vladimir wrote: > > Hi, > On amd64 struct wl_display from wayland-client.c can shrink in size > from 320 bytes to 304 if two fields (last_error and id) are > rearranged. Compiles fine. I believe you mean last_error and protocol_error.