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
+12
View File
@@ -3,6 +3,7 @@
#include <threads.h>
#include <unistd.h>
#include "alloc-util.h"
#include "memory-util.h"
size_t page_size(void) {
@@ -55,3 +56,14 @@ void* memdup_reverse(const void *mem, size_t size) {
return p;
}
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);
}