nsIScriptContext memory management

Mark Hammond mark at enfoldsystems.com
Tue, 22 Nov 2005 11:16:29 +1100


Hi guys,
  As discussed at the Content team meeting and its minutes, I have been
looking at the memory management for nsIScriptContext.

I have written this up at
http://wiki.mozilla.org/Memory_Management_for_nsIScriptContext.  A summary
is:

* Brendan decided on a "Drop/Hold" model.
* Manually doing Drop/Hold operations is very error prone, especially with
respect to "early returns".  Leaks here can be nasty.
* A clean technique to automate this isn't particularly obvious to me.  I
outline one such implementation, but also discuss its drawbacks.

As I mention in that document, I have an implementation but request feedback
before continuing further.

Thanks,

Mark.