util: define free_func_t
This commit is contained in:
@@ -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)))
|
||||
|
||||
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user