Skip to content

Instantly share code, notes, and snippets.

View alokmenghrajani's full-sized avatar
💾

Alok Menghrajani alokmenghrajani

💾
View GitHub Profile
@dgalling
dgalling / defer.h
Created November 7, 2014 19:44
Deferred free in C
typedef struct free_list_t {
void (*func)(void *);
void *arg;
struct free_list_t *next;
} FreeList;
void _defer(FreeList **f, void (*func)(void *), void *arg) {
if (arg == NULL) {
return;
}