chiark / gitweb /
unit: reduce heap usage for unit objects
[elogind.git] / src / unit.h
index 19314d6fbdde5c5f36dcddbc8b238454d1f69735..626bdc43af6b1a793a99d9f0c6011c93940cffa3 100644 (file)
@@ -286,6 +286,9 @@ union Unit {
 struct UnitVTable {
         const char *suffix;
 
+        /* How much memory does an object of this unit type need */
+        size_t object_size;
+
         /* Config file sections this unit type understands, separated
          * by NUL chars */
         const char *sections;
@@ -435,7 +438,7 @@ DEFINE_CAST(SNAPSHOT, Snapshot);
 DEFINE_CAST(SWAP, Swap);
 DEFINE_CAST(PATH, Path);
 
-Unit *unit_new(Manager *m);
+Unit *unit_new(Manager *m, size_t size);
 void unit_free(Unit *u);
 
 int unit_add_name(Unit *u, const char *name);