A Mark-and-Sweep Garbage Collector
Find a file
2024-08-20 13:28:23 -04:00
.gitignore Added .gitignore 2024-08-19 15:50:17 -04:00
gc.c GC: remove return value from collect() 2024-08-20 13:16:27 -04:00
gc.h GC: remove return value from collect() 2024-08-20 13:16:27 -04:00
main.c Silence clang warnings 2024-08-20 13:28:11 -04:00
Makefile Make: added vm.c to SRCS 2024-08-20 10:51:32 -04:00
README.md Add optional clang dependency 2024-08-20 13:28:23 -04:00
test_gc.h Added basic testing 2024-08-20 13:19:39 -04:00
vm.c VM: define initial GC threshold and check malloc for NULL 2024-08-20 13:18:35 -04:00
vm.h Silence clang warnings 2024-08-20 13:28:11 -04:00

marCsweep

A mark-and-sweep garbage collector with a simple virtual machine to perform allocations.

Building

Compiling the project should be relatively easy, even if you aren't familiar with make.

Dependences: git, make, and gcc. Compiling with clang is also possible, simply replace "gcc" with "clang" in the first line of the Makefile.

git clone https://codeberg.org/andyscott/marCsweep.git

cd marCsweep

make release

That's it! The Makefile will automatically create the build directory and place the compiled executable there.

Notes

This is a personal project that I am writing in my free time to learn more about garbage collection. That said, please remember that it does allocate real memory, which should not be taken lightly!