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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-03-06 17:46:59 +01:00
parent 54ed92e17c
commit 3abe1e53f6
2 changed files with 8 additions and 6 deletions
+7
View 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);
}
+1 -6
View 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) {