I haven't been doing much in the Dikurivative scene lately, but I figured I'd poke my head back over here and see what ya'll have been doing.
I had an idea a while ago, and was wondering if anyone has tried it yet. There is a very nice library called gc
, which appears to have a license option that would be compatible for inclusion (IE: not GPL).
What this does, is replace the system malloc and C++ new operators with a garbage-collecting malloc system. The free function becomes a no-op, and C++ delete destroys the object but doesn't free resources. Instead, the garbage collection system tracks anything which has a reference to anything in it, and when the reference count on a chunk of memory drops to zero, it is freed automatically.
This is how most modern languages work, although they hide the details from you.
Sooooo, I was wondering if anyone had tried this with SmaugFUSS? It would probably make the code a bit cleaner, and it would certainly make a whole class of pointer errors go away (not all of them, alas).