[webkit-reviews] review requested: [Bug 27980] Give an ability to WebKit to free statically allocated pointers before quit : [Attachment 41886] Proposed Partial Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 26 13:12:20 PDT 2009


Carol Szabo <carol.szabo at nokia.com> has asked  for review:
Bug 27980: Give an ability to WebKit to free statically allocated pointers
before quit
https://bugs.webkit.org/show_bug.cgi?id=27980

Attachment 41886: Proposed Partial Patch
https://bugs.webkit.org/attachment.cgi?id=41886&action=review

------- Additional Comments from Carol Szabo <carol.szabo at nokia.com>
This topic appears to be pretty controversial. It appears that there is not
much value at least for the Mac version of WebKit in making WebKit clean up its
singletons before it being unloaded.
Since a large change appears to be expensive in terms of development and review
time, and risky enough to be found unjustifiable for Apple, I propose this
small safe change, that does not solve the whole problem, but can constitute a
first step towards solving the problem.
My final goal is to have global resources (such as cashes, custom memory
management maps, default stylesheets, etc.) implemented in such a way that
after the last WebKit page, frame, document, script object, worker thread, etc.
has been deleted, these resources can be freed in any order, thus they can be
implemented as global variables, or via global smart pointers, etc. if one
wanted to.
I plan to provide macros for declaring and defining these global resources.
I also plan that by default these macros shall expand to pretty much the same
code as it is now used for the resources such that there is no impact on
performance.
In the absence of any other value, this current patch provides:
1. No impact on performance if the user does not redefine the
DEFINE_STATIC_LOCAL macro.
2. A slightly smaller, more consistent yet more configurable WebKit source code
which benefits future maintainability and usability.

I believe that on the basis of the above benefits alone, my patch should be
accepted, regardless of whether I manage to find a solution to the underlying
problem of singleton cleanup.


More information about the webkit-reviews mailing list