[Webkit-unassigned] [Bug 21810] Remove use of static C++ objects

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 22 14:39:40 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=21810


aroben at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aroben at apple.com




------- Comment #1 from aroben at apple.com  2008-10-22 14:39 PDT -------
(In reply to comment #0)
> Remove use of static C++ objects in general, but for an example from Timer.cpp:
> 
> static Vector<TimerBase*>* timerHeap;
> static HashSet<const TimerBase*>* timersReadyToFire;
> 
> In a multi-threaded WebCore environment, a thread may be using these while the
> main thread is deleting them causing crashes.

WebCore in general is not usable from multiple threads concurrently. I guess
this would be a step towards making it safe to use in that fashion?

> Objects like this are also held in memory until exit is called, when the C++
> runtime cleans these up. So the destructors only run at exit and don't really
> provide any benefit. Without them, the program would quit somewhat faster. ;)

The two examples you gave are just pointers, and thus don't cause any
destructors to run when the process exits. But what you said is true for static
objects.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list