Revert "basic/allow-util: make free_many non-inline"

This reverts commit 3abe1e53f6.

I remain unconvinced. The function is very short, and
by making it inline the assert()s can be optimized away.
This commit is contained in:
Mike Yuan
2026-07-25 19:37:47 +09:00
committed by Yu Watanabe
parent 89d48b71ae
commit d5d76ddd80
2 changed files with 6 additions and 8 deletions
-7
View File
@@ -164,10 +164,3 @@ void* greedy_realloc_append(
return q;
}
void free_many(void **p, size_t n) {
assert(p || n == 0);
FOREACH_ARRAY(i, p, n)
*i = mfree(*i);
}
+6 -1
View File
@@ -208,7 +208,12 @@ void* greedy_realloc_append(void **p, size_t *n_p, const void *from, size_t n_fr
#endif
/* Free every element of the array. */
void free_many(void **p, size_t n);
static inline void free_many(void **p, size_t n) {
assert(p || n == 0);
FOREACH_ARRAY(i, p, n)
*i = mfree(*i);
}
/* 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) {