]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/allow-util: make free_many non-inline
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Tue, 3 Mar 2026 08:42:41 +0000 (09:42 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 6 Mar 2026 16:46:59 +0000 (17:46 +0100)
Definition of free_many is moved to the .c file, no particular reason
for it to be inline and we can make the header file shorter.

src/basic/alloc-util.c
src/basic/alloc-util.h

index 58b70dede4b01b4bec30233dd75e4c73c3421ff9..94102dd430c0436954806d6f16c17a39ececfebc 100644 (file)
@@ -142,3 +142,10 @@ size_t malloc_sizeof_safe(void **xp) {
                 assert_not_reached();
         return sz;
 }
+
+void free_many(void **p, size_t n) {
+        assert(p || n == 0);
+
+        FOREACH_ARRAY(i, p, n)
+                *i = mfree(*i);
+}
index cd062d5fe3efc61c5cab10b78689b045f7bbf284..7d5c1da61f2ddeccc9e02b384984bc52b20d9054 100644 (file)
@@ -206,12 +206,7 @@ size_t malloc_sizeof_safe(void **xp);
                 VOID_0))
 
 /* Free every element of the array. */
-static inline void free_many(void **p, size_t n) {
-        assert(p || n == 0);
-
-        FOREACH_ARRAY(i, p, n)
-                *i = mfree(*i);
-}
+void free_many(void **p, size_t n);
 
 /* Typesafe wrapper for char** rather than void**. Unfortunately C won't implicitly cast this. */
 static inline void free_many_charp(char **c, size_t n) {