neilparikh / gccollect

A garbage collector for C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GCcollect

A mark and sweep garbage collector in/for C.

Usage

On a high level:

  • use GCmalloc and GCfree to allocate and free memory you want garbage collected
  • register all pointers that point to memory allocated using GCmalloc
  • call GCcollect to trigger a garbage collection. This will trigger a GC pause, as the collector uses mark and sweep.
  • call GCFreeAll at the end of your program so the collector can do some cleanup

See gccollect.h for the specific API.

About

A garbage collector for C


Languages

Language:C 85.1%Language:C++ 13.4%Language:Makefile 1.5%