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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user