/gc

minimalist 42 norme ready garbage collector

Primary LanguageC

gc

Norminette ready Garbage Collector library for 42 projects

Examples

Initialization

t_gcan  gc;
gc_init(&gc);

Allocate memory

ptr = gc_malloc(&gc, sizeof(struct mystruct));

Free memory

// before => ptr != NULL
gc_free(&gc, (void **)&ptr);
// after => ptr == NULL

Free all tracked memory

gc_clean(&gc);