sysusers: drop counterproductive bitfield annotations
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 31 Jan 2023 12:47:17 +0000 (13:47 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 31 Jan 2023 12:47:17 +0000 (13:47 +0100)
commit616c53544fa280a05545a88ce3a6bb0680bb4650
treec6eeef26b03eb07c0a3acb0cb9379ad7628aa891
parent907046282c27ee2ced5e22abb80ed8df2e157baf
sysusers: drop counterproductive bitfield annotations

The usual story:
$ diff -u <(pahole build/systemd-sysusers.0) <(pahole build/systemd-sysusers)
  /* size: 80, cachelines: 2, members: 15 */
- /* sum members: 68, holes: 1, sum holes: 4 */
- /* sum bitfield members: 5 bits (0 bytes) */
- /* padding: 7 */
- /* bit_padding: 3 bits */
+ /* sum members: 73, holes: 1, sum holes: 4 */
+ /* padding: 3 */
  /* last cacheline: 16 bytes */

Effectively, because of padding, we were not saving anything. We're not putting
struct Item in arrays, but when allocating on the heap, we're going to round up to
normal alignment too.

The code becomes shorter (and quicker):
$ size build/systemd-sysusers{,.0}
   text    data     bss     dec     hex filename
  79967    2040     264   82271   1415f build/systemd-sysusers.0
  79726    2040     264   82030   1406e build/systemd-sysusers

(In case you're wondering, I wrote this long commit message for a very simple
change on purpose: I want to deflate the bitfield cargo cult a bit.)
src/sysusers/sysusers.c