[Webkit-unassigned] [Bug 97539] Broken and incorrect code in FastMalloc.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 26 09:40:34 PDT 2012


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





--- Comment #10 from Alexey Proskuryakov <ap at webkit.org>  2012-09-26 09:41:01 PST ---
> 1) The comment "m_scavengeMutex should be held before accessing m_scavengeThreadActive." is misleading, it should be stating "the caller [of signalScavenger()] should ensure that m_scavengeMutex is locked prior to calling this method."

Yes, I like your variant more. I'd have said "taken" and not "locked", but either works for me.

> I'm not sure if your comment is based on a misunderstanding of the pthread_cond_wait(&m_scavengeCondition, &m_scavengeMutex); code - this atomically waits on the condvar and unlocks the mutex.

I wrote this code a few years ago, and that the logic was supposed to match what's in the version that is actually used:

ALWAYS_INLINE void TCMalloc_PageHeap::signalScavenger()
{
    ASSERT(pageheap_lock.IsHeld());
...

Of course, being an unused branch, it was not tested, and didn't even compile. It's quite possible that a major cleanup of the algorithm is needed there.

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


More information about the webkit-unassigned mailing list