]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: drop bitfields in VTable object
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 4 Jun 2021 12:46:59 +0000 (14:46 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 4 Jun 2021 12:54:19 +0000 (14:54 +0200)
The usual: bitfields make sense as a memory-saving measure when we have many
objects of a given type. When the object appears at most in a few copies, the
overhead of additional code to access bitfields is more than the savings.

src/core/unit.h

index 2db40e51e852a94a8e487f087cf723dec68184fb..dddb41961375919ba788c577744f603b9ca15c7c 100644 (file)
@@ -646,7 +646,7 @@ typedef struct UnitVTable {
         /* Type specific cleanups. */
         void (*shutdown)(Manager *m);
 
-        /* If this function is set and return false all jobs for units
+        /* If this function is set and returns false all jobs for units
          * of this type will immediately fail. */
         bool (*supported)(void);
 
@@ -654,25 +654,25 @@ typedef struct UnitVTable {
         UnitStatusMessageFormats status_message_formats;
 
         /* True if transient units of this type are OK */
-        bool can_transient:1;
+        bool can_transient;
 
         /* True if cgroup delegation is permissible */
-        bool can_delegate:1;
+        bool can_delegate;
 
         /* True if the unit type triggers other units, i.e. can have a UNIT_TRIGGERS dependency */
-        bool can_trigger:1;
+        bool can_trigger;
 
         /* True if the unit type knows a failure state, and thus can be source of an OnFailure= dependency */
-        bool can_fail:1;
+        bool can_fail;
 
         /* True if units of this type shall be startable only once and then never again */
-        bool once_only:1;
+        bool once_only;
 
         /* True if queued jobs of this type should be GC'ed if no other job needs them anymore */
-        bool gc_jobs:1;
+        bool gc_jobs;
 
         /* True if systemd-oomd can monitor and act on this unit's recursive children's cgroup(s)  */
-        bool can_set_managed_oom:1;
+        bool can_set_managed_oom;
 } UnitVTable;
 
 extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX];