Krysztof,
Hi,
I'm not the wizard on this, but I think I can give a fairly good answer (Mental, please correct my obvious errors here :-) !
The reason is, that not everything in Inkscape is C++ yet, and we need to use the lower-level functions of Boehm rather than relying on C++ stuff. A lot of Inkscape things are still C wrapped in C++. Some day that will be different, but it still hasn't happened yet.
bob (ishmal)
Krzysztof Kosiński wrote:
The main usage pattern for garbage-collected classes I see is:
Inkscape::XML::Node *foo = doc->createElement("foo"); parent->appendChild(foo); Inkscape::GC::release(foo);
This looks very malloc-free-ish. Why not, instead of deriving from the GC-managed classes, derive from Glib::ObjectBase and then use Glib::RefPtr everywhere? During the migration period, SPObjects etc. can be derived from both Inkscape::GC::Managed etc. and Glib::ObjectBase, and overload the reference() and unreference() virtual methods to call Inkscape::GC::anchor() and Inkscape::GC::release().
However, I don't know the codebase too well, so probably there's some more fundamental reason to using libgc other than managing objects which have multiple references - please enlighten me :).
Regards, Krzysztof Kosiński