basic: Remove circular dep between alloc-util.h and memory-util.h

This commit is contained in:
Daan De Meyer
2025-04-18 14:19:16 +02:00
parent 5d226b2f9a
commit 95609f3dff
7 changed files with 17 additions and 14 deletions
+1 -11
View File
@@ -7,7 +7,6 @@
#include <string.h>
#include <sys/types.h>
#include "alloc-util.h"
#include "macro.h"
#include "memory-util-fundamental.h"
@@ -98,16 +97,7 @@ static inline void* mempmem_safe(const void *haystack, size_t haystacklen, const
return (uint8_t*) p + needlelen;
}
static inline void* erase_and_free(void *p) {
size_t l;
if (!p)
return NULL;
l = MALLOC_SIZEOF_SAFE(p);
explicit_bzero_safe(p, l);
return mfree(p);
}
void* erase_and_free(void *p);
static inline void erase_and_freep(void *p) {
erase_and_free(*(void**) p);