Skip Navigation

AllocPPx.pl -> A Perl script that preprocesses C with garbage collection!

gist.github.com AllocPPx.pl -> A C preprocessor that adds garbage collection

AllocPPx.pl -> A C preprocessor that adds garbage collection - allocppx.1

AllocPPx.pl -> A C preprocessor that adds garbage collection

Automatic garbage collection in C is possible with libraries like libgc, but with allocppx.pl, you can just preprocess your file into generating heaps, and these heaps can be used for memory allocation. The type of GC is used, mark and sweep + reference counting. Every memory allocation MAY have a trace, and this trace can be used to 'refget' and 'refunget'. Heap items that are NULL or have 0 refs are collected via mark and sweep.

The generated code is very readable, you can just look at it to get a clue. However, this Perl document is annotated with POD so you can view it in man pages etc. I have submitted an ASCII render of the manpage in Gist.

I hope you enjoy this.

17

You're viewing a single thread.

17 comments
You've viewed 17 comments.