Skip to content

Simple garbage collector in C to manage dynamic memory allocations.

Notifications You must be signed in to change notification settings

MathysCogne/my_garbage_collector_c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Garbage Collector

Banner Garbage Collector C

Simple garbage collector in C to manage dynamic memory allocations.



Initialization

Initialize the garbage collector:

t_gc	*gc;
gc = gc_init();

Add to the garbage collector

char *str = strdup("Hello, 42 !");
if (!str)
{
	gc_clean(gc);
	return (1);
}
gc_add(gc, (void *)str);

Clean

Remove and free one:

gc_remove_one(gc, (void *)str);

Remove and free all:

gc_clean(gc);

Debug

Print all allocations in the garbage collector:

gc_print_debug(gc);

About

Simple garbage collector in C to manage dynamic memory allocations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published