From d53017292edcad2dfe94340320fdd91a80f56cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 19 Feb 2024 12:20:20 +0100 Subject: [PATCH] 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. --- src/timesync/timesyncd-manager.h | 3 +-- src/timesync/timesyncd-server.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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); };