From: Zbigniew Jędrzejewski-Szmek Date: Mon, 19 Feb 2024 11:20:20 +0000 (+0100) Subject: timesyncd: reorder structs instead of useless bitfields X-Git-Tag: v256-rc1~802^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d53017292edcad2dfe94340320fdd91a80f56cd4;p=thirdparty%2Fsystemd.git timesyncd: reorder structs instead of useless bitfields Because of alignment, those bitfields were not doing anything useful, and were causing the generated code to be more complicated. But in this case, at least potentially there might be a number of copies of those structs (if we have a bunch of time servers configured), so let's actually implement the intended space savings by reording the fields to reduce the size of holes. --- diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h index f4447874897..027ec52dac7 100644 --- a/src/timesync/timesyncd-manager.h +++ b/src/timesync/timesyncd-manager.h @@ -45,10 +45,9 @@ struct Manager { LIST_HEAD(ServerName, runtime_servers); LIST_HEAD(ServerName, fallback_servers); - bool have_fallbacks:1; - RateLimit ratelimit; bool exhausted_servers; + bool have_fallbacks; /* network */ sd_event_source *network_event_source; diff --git a/src/timesync/timesyncd-server.h b/src/timesync/timesyncd-server.h index e22917aa129..a4b56377312 100644 --- a/src/timesync/timesyncd-server.h +++ b/src/timesync/timesyncd-server.h @@ -30,11 +30,11 @@ struct ServerAddress { struct ServerName { Manager *manager; + bool marked; + ServerType type; char *string; - bool marked:1; - LIST_HEAD(ServerAddress, addresses); LIST_FIELDS(ServerName, names); };