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