
On Apr 16, 2010, at 8:12 AM, bulia byak wrote:
- Memory management. NRArena uses the Boehm garbage collector.
This is sometimes poorly compatible with Cairo. I will introduce an explicit memory management strategy based on smart pointers and/or rigorously specified ownership semantics.
I think I would much prefer a rigorous ownership semantics option. Arena items live easily definable lives and I don't really see why anything more complex might have been necessary. One issue I recall is that arena items hold pointers to the same SPStyle objects as their parent SPObjects, which I think was a problem resulting in memory leaks and other bugs (please contact Mentalguy for more on that, he's the best person to know about all that).
I would definitely second this point on the memory management.
Going with smart pointers really tends to lead to almost the same complications we have now with Boehm and its use. Since care is going to be required anyway in order to get all things working, and well, a little extra care in specifying ownership semantics will give us better safety while also helping improve performance. And specifically in the Inkscape codebase, switching from "magic" memory handling to consistent and explicit ownership has been seen to be a bigger gain.