]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesyncd: reorder structs instead of useless bitfields
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 19 Feb 2024 11:20:20 +0000 (12:20 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Feb 2024 09:41:09 +0000 (10:41 +0100)
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.

src/timesync/timesyncd-manager.h
src/timesync/timesyncd-server.h

index f4447874897ca99c4506d7ab326657bd2ffdebfc..027ec52dac7025fae61f1e27a88760ea8fb84d80 100644 (file)
@@ -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;
index e22917aa12914fa0f7826ab4a88c1cef10a958c4..a4b56377312c6efffa30ba54a19f805508806551 100644 (file)
@@ -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);
 };