From 3abe1e53f657982a7a6ab6861cf0b3962cbbb3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 3 Mar 2026 09:42:41 +0100 Subject: [PATCH] basic/allow-util: make free_many non-inline 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 | 7 +++++++ src/basic/alloc-util.h | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/basic/alloc-util.c b/src/basic/alloc-util.c index 58b70dede4..94102dd430 100644 --- a/src/basic/alloc-util.c +++ b/src/basic/alloc-util.c @@ -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); +} diff --git a/src/basic/alloc-util.h b/src/basic/alloc-util.h index cd062d5fe3..7d5c1da61f 100644 --- a/src/basic/alloc-util.h +++ b/src/basic/alloc-util.h @@ -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) {