util: define free_func_t

This commit is contained in:
Yu Watanabe
2018-12-02 06:34:25 +01:00
parent ee05335f43
commit e30f9c972b
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -8,6 +8,8 @@
#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)))
+2 -1
View File
@@ -1,5 +1,6 @@
#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
@@ -9,7 +10,7 @@
typedef struct StaticDestructor {
void *data;
void (*destroy)(void *p);
free_func_t destroy;
} StaticDestructor;
#define STATIC_DESTRUCTOR_REGISTER(variable, func) \