bog
bog copied to clipboard
Garbage collector reimplementation
A pretty simple mark-sweep garbage collector. In most cases this should be similarly performant to a bump allocator.
The most interesting thing about it is the used/free object tracking, which uses a bit set in with a binary-heap indexing strategy to keep track of objects that are either in use or not collected yet, the idea being that looking for a free object in a relatively full list should remain fast. I'm not sure this is actually more useful than keeping a simple list of freed indices, but I thought the idea was worth taking a stab at.