#include "macro.h"
+typedef void (*free_func_t)(void *p);
+
#define new(t, n) ((t*) malloc_multiply(sizeof(t), (n)))
#define new0(t, n) ((t*) calloc((n), sizeof(t)))
#pragma once
+#include "alloc-util.h"
#include "macro.h"
/* A framework for registering static variables that shall be freed on shutdown of a process. It's a bit like gcc's
typedef struct StaticDestructor {
void *data;
- void (*destroy)(void *p);
+ free_func_t destroy;
} StaticDestructor;
#define STATIC_DESTRUCTOR_REGISTER(variable, func) \