There is a simple way to change the collectability of objects. You start by making everything collectable. You have a command gcMakeManual(void *p) which adds p to a table. and a command gcMakeCollectable(void *p) which removes things from the table. You might want to have a Manual count on the table. It depends on your usage. Its not elegant but it works.