Hi folks,
I've been wanting to write a garbagecollector for C++ for a little while...
my idea is that all objects inherited from "CGCObject" will be
garbage-collected if no longer used.
So all I would have to do is:
CMyClass *pTest = new CMyClass(); // CMyClass inherits CGCObject
My aproach has been the "mark and sweep" algorithm, but I haven't been able
to come up with anything where no additional programming is needed for the
programs using CGCObject.
The reason I don't just use reference-counting is because of the possible
cyclic references holding objects alive even though they should have been
deleted.
Can anyone give some hints or references to existing lib's with similar
functionality?
--
Lasse