Skip to content

A humble attempt to create a pseudo garbage collector in C. All it does is interfacing both memory allocation and destruction, using linked list to store all allocated memory as pointers.

Notifications You must be signed in to change notification settings

Ximaz/C-garbage-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Garbage Collector

A humble attempt to create a pseudo garbage collector in C.

Functions

// Memory allocation interface
void *gc_alloc(gc_t *gc, size_t size);

// Memory-specific destruction interface (only the specified address)
bool gc_free(gc_t *gc, void *address);

// Memory destruction interface (any allocated memory)
bool gc_free_all(gc_t *gc);

Setup

Compilation is done using make command :

git clone https://github.com/Ximaz/C-garbage-collector
cd C-garbage-collector
make

Once compilatoin is done, you get a libgc.a file that you can link to your projects.

About

A humble attempt to create a pseudo garbage collector in C. All it does is interfacing both memory allocation and destruction, using linked list to store all allocated memory as pointers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published