babyvm icon indicating copy to clipboard operation
babyvm copied to clipboard

Baby's First Garbage Collector

Baby's First Garbage Collector

This is an implementation of a simple mark & sweep garbage collector as described at Bob Nystrom's blog post Baby's First Garbage Collector.

Description

Bob's code was easy to follow, but I was interested in seeing it work for myself. I though it would be useful to create a barebones projects for others interested in toying with a simple garbage collector.

I also took the liberty of peppering some printfs around to report the status of various things.

It's also been many years since I wrote any C and this was a nice reminder of how to do it.

Compiling

Requires make and gcc. Compile with make and run make clean to destroy the evidence.

Running

After compiling simply execute the babyvm binary and enjoy!