<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[167540] trunk/Source/bmalloc</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/167540">167540</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2014-04-19 11:36:56 -0700 (Sat, 19 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>bmalloc: Mutex should be harder to use wrong
https://bugs.webkit.org/show_bug.cgi?id=131879

Reviewed by Andreas Kling.

Mutex now has a proper constructor, so you can't deadlock by forgetting
to initialize it.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/Allocator.cpp:
(bmalloc::Allocator::processXSmallAllocatorLog):
(bmalloc::Allocator::processSmallAllocatorLog):
(bmalloc::Allocator::processMediumAllocatorLog):
(bmalloc::Allocator::allocateLarge):
(bmalloc::Allocator::allocateXLarge): Global replace Mutex =&gt; StaticMutex,
since the Heap mutex is a static.

* bmalloc/AsyncTask.h:
(bmalloc::Function&gt;::AsyncTask): Use Mutex, since we're not static. No
need for explicit initialization anymore.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::scavenge):
(bmalloc::Deallocator::deallocateLarge):
(bmalloc::Deallocator::deallocateXLarge):
(bmalloc::Deallocator::processObjectLog):
(bmalloc::Deallocator::deallocateSmallLine):
(bmalloc::Deallocator::deallocateXSmallLine):
(bmalloc::Deallocator::allocateSmallLine):
(bmalloc::Deallocator::allocateXSmallLine):
(bmalloc::Deallocator::deallocateMediumLine):
(bmalloc::Deallocator::allocateMediumLine):
* bmalloc/Deallocator.h:
* bmalloc/Heap.cpp:
(bmalloc::sleep):
(bmalloc::Heap::Heap):
(bmalloc::Heap::concurrentScavenge):
(bmalloc::Heap::scavenge):
(bmalloc::Heap::scavengeSmallPages):
(bmalloc::Heap::scavengeXSmallPages):
(bmalloc::Heap::scavengeMediumPages):
(bmalloc::Heap::scavengeLargeRanges):
(bmalloc::Heap::allocateXSmallLineSlowCase):
(bmalloc::Heap::allocateSmallLineSlowCase):
(bmalloc::Heap::allocateMediumLineSlowCase):
(bmalloc::Heap::allocateXLarge):
(bmalloc::Heap::deallocateXLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::deallocateLarge):
* bmalloc/Heap.h:
(bmalloc::Heap::deallocateXSmallLine):
(bmalloc::Heap::allocateXSmallLine):
(bmalloc::Heap::deallocateSmallLine):
(bmalloc::Heap::allocateSmallLine):
(bmalloc::Heap::deallocateMediumLine):
(bmalloc::Heap::allocateMediumLine):
* bmalloc/Line.h:
(bmalloc::Line&lt;Traits&gt;::deref):
* bmalloc/Mutex.cpp: Removed.
* bmalloc/Mutex.h:
(bmalloc::Mutex::Mutex):
(bmalloc::Mutex::init): Deleted.
(bmalloc::Mutex::try_lock): Deleted.
(bmalloc::Mutex::lock): Deleted.
(bmalloc::Mutex::unlock): Deleted.
* bmalloc/Page.h:
(bmalloc::Page&lt;Traits&gt;::ref):
(bmalloc::Page&lt;Traits&gt;::deref):
(bmalloc::Page&lt;Traits&gt;::refCount):
* bmalloc/PerProcess.h:
(bmalloc::PerProcess::mutex):
(bmalloc::PerProcess&lt;T&gt;::getSlowCase):
* bmalloc/StaticMutex.cpp: Added.
(bmalloc::StaticMutex::lockSlowCase):
* bmalloc/StaticMutex.h: Added.
(bmalloc::StaticMutex::init):
(bmalloc::StaticMutex::try_lock):
(bmalloc::StaticMutex::lock):
(bmalloc::StaticMutex::unlock):
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::deallocateXSmallPage):
(bmalloc::VMHeap::deallocateSmallPage):
(bmalloc::VMHeap::deallocateMediumPage):
(bmalloc::VMHeap::deallocateLargeRange):
* bmalloc/bmalloc.h:
(bmalloc::api::scavenge): Global replace Mutex =&gt; StaticMutex,
since the Heap mutex is a static.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourcebmallocChangeLog">trunk/Source/bmalloc/ChangeLog</a></li>
<li><a href="#trunkSourcebmallocbmallocAllocatorcpp">trunk/Source/bmalloc/bmalloc/Allocator.cpp</a></li>
<li><a href="#trunkSourcebmallocbmallocAsyncTaskh">trunk/Source/bmalloc/bmalloc/AsyncTask.h</a></li>
<li><a href="#trunkSourcebmallocbmallocDeallocatorcpp">trunk/Source/bmalloc/bmalloc/Deallocator.cpp</a></li>
<li><a href="#trunkSourcebmallocbmallocDeallocatorh">trunk/Source/bmalloc/bmalloc/Deallocator.h</a></li>
<li><a href="#trunkSourcebmallocbmallocHeapcpp">trunk/Source/bmalloc/bmalloc/Heap.cpp</a></li>
<li><a href="#trunkSourcebmallocbmallocHeaph">trunk/Source/bmalloc/bmalloc/Heap.h</a></li>
<li><a href="#trunkSourcebmallocbmallocLineh">trunk/Source/bmalloc/bmalloc/Line.h</a></li>
<li><a href="#trunkSourcebmallocbmallocMutexh">trunk/Source/bmalloc/bmalloc/Mutex.h</a></li>
<li><a href="#trunkSourcebmallocbmallocPageh">trunk/Source/bmalloc/bmalloc/Page.h</a></li>
<li><a href="#trunkSourcebmallocbmallocPerProcessh">trunk/Source/bmalloc/bmalloc/PerProcess.h</a></li>
<li><a href="#trunkSourcebmallocbmallocVMHeaph">trunk/Source/bmalloc/bmalloc/VMHeap.h</a></li>
<li><a href="#trunkSourcebmallocbmallocbmalloch">trunk/Source/bmalloc/bmalloc/bmalloc.h</a></li>
<li><a href="#trunkSourcebmallocbmallocxcodeprojprojectpbxproj">trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourcebmallocbmallocStaticMutexcpp">trunk/Source/bmalloc/bmalloc/StaticMutex.cpp</a></li>
<li><a href="#trunkSourcebmallocbmallocStaticMutexh">trunk/Source/bmalloc/bmalloc/StaticMutex.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourcebmallocbmallocMutexcpp">trunk/Source/bmalloc/bmalloc/Mutex.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourcebmallocChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/ChangeLog (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/ChangeLog        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/ChangeLog        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -1,3 +1,93 @@
</span><ins>+2014-04-19  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        bmalloc: Mutex should be harder to use wrong
+        https://bugs.webkit.org/show_bug.cgi?id=131879
+
+        Reviewed by Andreas Kling.
+
+        Mutex now has a proper constructor, so you can't deadlock by forgetting
+        to initialize it.
+
+        * bmalloc.xcodeproj/project.pbxproj:
+        * bmalloc/Allocator.cpp:
+        (bmalloc::Allocator::processXSmallAllocatorLog):
+        (bmalloc::Allocator::processSmallAllocatorLog):
+        (bmalloc::Allocator::processMediumAllocatorLog):
+        (bmalloc::Allocator::allocateLarge):
+        (bmalloc::Allocator::allocateXLarge): Global replace Mutex =&gt; StaticMutex,
+        since the Heap mutex is a static.
+
+        * bmalloc/AsyncTask.h:
+        (bmalloc::Function&gt;::AsyncTask): Use Mutex, since we're not static. No
+        need for explicit initialization anymore.
+
+        * bmalloc/Deallocator.cpp:
+        (bmalloc::Deallocator::scavenge):
+        (bmalloc::Deallocator::deallocateLarge):
+        (bmalloc::Deallocator::deallocateXLarge):
+        (bmalloc::Deallocator::processObjectLog):
+        (bmalloc::Deallocator::deallocateSmallLine):
+        (bmalloc::Deallocator::deallocateXSmallLine):
+        (bmalloc::Deallocator::allocateSmallLine):
+        (bmalloc::Deallocator::allocateXSmallLine):
+        (bmalloc::Deallocator::deallocateMediumLine):
+        (bmalloc::Deallocator::allocateMediumLine):
+        * bmalloc/Deallocator.h:
+        * bmalloc/Heap.cpp:
+        (bmalloc::sleep):
+        (bmalloc::Heap::Heap):
+        (bmalloc::Heap::concurrentScavenge):
+        (bmalloc::Heap::scavenge):
+        (bmalloc::Heap::scavengeSmallPages):
+        (bmalloc::Heap::scavengeXSmallPages):
+        (bmalloc::Heap::scavengeMediumPages):
+        (bmalloc::Heap::scavengeLargeRanges):
+        (bmalloc::Heap::allocateXSmallLineSlowCase):
+        (bmalloc::Heap::allocateSmallLineSlowCase):
+        (bmalloc::Heap::allocateMediumLineSlowCase):
+        (bmalloc::Heap::allocateXLarge):
+        (bmalloc::Heap::deallocateXLarge):
+        (bmalloc::Heap::allocateLarge):
+        (bmalloc::Heap::deallocateLarge):
+        * bmalloc/Heap.h:
+        (bmalloc::Heap::deallocateXSmallLine):
+        (bmalloc::Heap::allocateXSmallLine):
+        (bmalloc::Heap::deallocateSmallLine):
+        (bmalloc::Heap::allocateSmallLine):
+        (bmalloc::Heap::deallocateMediumLine):
+        (bmalloc::Heap::allocateMediumLine):
+        * bmalloc/Line.h:
+        (bmalloc::Line&lt;Traits&gt;::deref):
+        * bmalloc/Mutex.cpp: Removed.
+        * bmalloc/Mutex.h:
+        (bmalloc::Mutex::Mutex):
+        (bmalloc::Mutex::init): Deleted.
+        (bmalloc::Mutex::try_lock): Deleted.
+        (bmalloc::Mutex::lock): Deleted.
+        (bmalloc::Mutex::unlock): Deleted.
+        * bmalloc/Page.h:
+        (bmalloc::Page&lt;Traits&gt;::ref):
+        (bmalloc::Page&lt;Traits&gt;::deref):
+        (bmalloc::Page&lt;Traits&gt;::refCount):
+        * bmalloc/PerProcess.h:
+        (bmalloc::PerProcess::mutex):
+        (bmalloc::PerProcess&lt;T&gt;::getSlowCase):
+        * bmalloc/StaticMutex.cpp: Added.
+        (bmalloc::StaticMutex::lockSlowCase):
+        * bmalloc/StaticMutex.h: Added.
+        (bmalloc::StaticMutex::init):
+        (bmalloc::StaticMutex::try_lock):
+        (bmalloc::StaticMutex::lock):
+        (bmalloc::StaticMutex::unlock):
+        * bmalloc/VMHeap.h:
+        (bmalloc::VMHeap::deallocateXSmallPage):
+        (bmalloc::VMHeap::deallocateSmallPage):
+        (bmalloc::VMHeap::deallocateMediumPage):
+        (bmalloc::VMHeap::deallocateLargeRange):
+        * bmalloc/bmalloc.h:
+        (bmalloc::api::scavenge): Global replace Mutex =&gt; StaticMutex,
+        since the Heap mutex is a static.
+
</ins><span class="cx"> 2014-04-18  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         bmalloc: AsyncTask should use Mutex instead of std::mutex
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocAllocatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Allocator.cpp (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Allocator.cpp        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Allocator.cpp        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Allocator::processXSmallAllocatorLog()
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; logEntry : m_xSmallAllocatorLog) {
</span><span class="cx">         if (!logEntry.first-&gt;deref(lock, logEntry.second))
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Allocator::processSmallAllocatorLog()
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; logEntry : m_smallAllocatorLog) {
</span><span class="cx">         if (!logEntry.first-&gt;deref(lock, logEntry.second))
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Allocator::processMediumAllocatorLog()
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; logEntry : m_mediumAllocatorLog) {
</span><span class="cx">         if (!logEntry.first-&gt;deref(lock, logEntry.second))
</span><span class="lines">@@ -141,14 +141,14 @@
</span><span class="cx"> void* Allocator::allocateLarge(size_t size)
</span><span class="cx"> {
</span><span class="cx">     size = roundUpToMultipleOf&lt;largeAlignment&gt;(size);
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     return PerProcess&lt;Heap&gt;::getFastCase()-&gt;allocateLarge(lock, size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void* Allocator::allocateXLarge(size_t size)
</span><span class="cx"> {
</span><span class="cx">     size = roundUpToMultipleOf&lt;largeAlignment&gt;(size);
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     return PerProcess&lt;Heap&gt;::getFastCase()-&gt;allocateXLarge(lock, size);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocAsyncTaskh"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/AsyncTask.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/AsyncTask.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/AsyncTask.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">     , m_object(object)
</span><span class="cx">     , m_function(function)
</span><span class="cx"> {
</span><del>-    m_conditionMutex.init();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Object, typename Function&gt;
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocDeallocatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Deallocator.cpp (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Deallocator.cpp        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Deallocator.cpp        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> {
</span><span class="cx">     processObjectLog();
</span><span class="cx">     
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     Heap* heap = PerProcess&lt;Heap&gt;::getFastCase();
</span><span class="cx">     
</span><span class="cx">     while (m_xSmallLineCache.size())
</span><span class="lines">@@ -68,19 +68,19 @@
</span><span class="cx"> 
</span><span class="cx"> void Deallocator::deallocateLarge(void* object)
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     PerProcess&lt;Heap&gt;::getFastCase()-&gt;deallocateLarge(lock, object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Deallocator::deallocateXLarge(void* object)
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     PerProcess&lt;Heap&gt;::getFastCase()-&gt;deallocateXLarge(lock, object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Deallocator::processObjectLog()
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     
</span><span class="cx">     for (auto object : m_objectLog) {
</span><span class="cx">         if (isXSmall(object)) {
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">     return deallocateXLarge(object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Deallocator::deallocateSmallLine(std::lock_guard&lt;Mutex&gt;&amp; lock, SmallLine* line)
</del><ins>+void Deallocator::deallocateSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock, SmallLine* line)
</ins><span class="cx"> {
</span><span class="cx">     if (m_smallLineCache.size() == m_smallLineCache.capacity())
</span><span class="cx">         return PerProcess&lt;Heap&gt;::getFastCase()-&gt;deallocateSmallLine(lock, line);
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">     m_smallLineCache.push(line);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Deallocator::deallocateXSmallLine(std::lock_guard&lt;Mutex&gt;&amp; lock, XSmallLine* line)
</del><ins>+void Deallocator::deallocateXSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock, XSmallLine* line)
</ins><span class="cx"> {
</span><span class="cx">     if (m_xSmallLineCache.size() == m_xSmallLineCache.capacity())
</span><span class="cx">         return PerProcess&lt;Heap&gt;::getFastCase()-&gt;deallocateXSmallLine(lock, line);
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> SmallLine* Deallocator::allocateSmallLine()
</span><span class="cx"> {
</span><span class="cx">     if (!m_smallLineCache.size()) {
</span><del>-        std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+        std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">         Heap* heap = PerProcess&lt;Heap&gt;::getFastCase();
</span><span class="cx"> 
</span><span class="cx">         while (m_smallLineCache.size() != m_smallLineCache.capacity())
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> XSmallLine* Deallocator::allocateXSmallLine()
</span><span class="cx"> {
</span><span class="cx">     if (!m_xSmallLineCache.size()) {
</span><del>-        std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+        std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">         Heap* heap = PerProcess&lt;Heap&gt;::getFastCase();
</span><span class="cx"> 
</span><span class="cx">         while (m_xSmallLineCache.size() != m_xSmallLineCache.capacity())
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx">     return m_xSmallLineCache.pop();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Deallocator::deallocateMediumLine(std::lock_guard&lt;Mutex&gt;&amp; lock, MediumLine* line)
</del><ins>+void Deallocator::deallocateMediumLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock, MediumLine* line)
</ins><span class="cx"> {
</span><span class="cx">     if (m_mediumLineCache.size() == m_mediumLineCache.capacity())
</span><span class="cx">         return PerProcess&lt;Heap&gt;::getFastCase()-&gt;deallocateMediumLine(lock, line);
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx"> MediumLine* Deallocator::allocateMediumLine()
</span><span class="cx"> {
</span><span class="cx">     if (!m_mediumLineCache.size()) {
</span><del>-        std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+        std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">         Heap* heap = PerProcess&lt;Heap&gt;::getFastCase();
</span><span class="cx"> 
</span><span class="cx">         while (m_mediumLineCache.size() != m_mediumLineCache.capacity())
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocDeallocatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Deallocator.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Deallocator.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Deallocator.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -45,13 +45,13 @@
</span><span class="cx">     bool deallocateFastCase(void*);
</span><span class="cx">     void deallocateSlowCase(void*);
</span><span class="cx"> 
</span><del>-    void deallocateXSmallLine(std::lock_guard&lt;Mutex&gt;&amp;, XSmallLine*);
</del><ins>+    void deallocateXSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp;, XSmallLine*);
</ins><span class="cx">     XSmallLine* allocateXSmallLine();
</span><span class="cx"> 
</span><del>-    void deallocateSmallLine(std::lock_guard&lt;Mutex&gt;&amp;, SmallLine*);
</del><ins>+    void deallocateSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp;, SmallLine*);
</ins><span class="cx">     SmallLine* allocateSmallLine();
</span><span class="cx"> 
</span><del>-    void deallocateMediumLine(std::lock_guard&lt;Mutex&gt;&amp;, MediumLine*);
</del><ins>+    void deallocateMediumLine(std::lock_guard&lt;StaticMutex&gt;&amp;, MediumLine*);
</ins><span class="cx">     MediumLine* allocateMediumLine();
</span><span class="cx">     
</span><span class="cx">     void scavenge();
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Heap.cpp (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Heap.cpp        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Heap.cpp        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace bmalloc {
</span><span class="cx"> 
</span><del>-static inline void sleep(std::unique_lock&lt;Mutex&gt;&amp; lock, std::chrono::milliseconds duration)
</del><ins>+static inline void sleep(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds duration)
</ins><span class="cx"> {
</span><span class="cx">     if (duration == std::chrono::milliseconds(0))
</span><span class="cx">         return;
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">     lock.lock();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Heap::Heap(std::lock_guard&lt;Mutex&gt;&amp;)
</del><ins>+Heap::Heap(std::lock_guard&lt;StaticMutex&gt;&amp;)
</ins><span class="cx">     : m_isAllocatingPages(false)
</span><span class="cx">     , m_scavenger(*this, &amp;Heap::concurrentScavenge)
</span><span class="cx"> {
</span><span class="lines">@@ -55,11 +55,11 @@
</span><span class="cx"> 
</span><span class="cx"> void Heap::concurrentScavenge()
</span><span class="cx"> {
</span><del>-    std::unique_lock&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::unique_lock&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     scavenge(lock, scavengeSleepDuration);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void Heap::scavenge(std::unique_lock&lt;Mutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</del><ins>+void Heap::scavenge(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</ins><span class="cx"> {
</span><span class="cx">     scavengeXSmallPages(lock, sleepDuration);
</span><span class="cx">     scavengeSmallPages(lock, sleepDuration);
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     sleep(lock, sleepDuration);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::scavengeSmallPages(std::unique_lock&lt;Mutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</del><ins>+void Heap::scavengeSmallPages(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</ins><span class="cx"> {
</span><span class="cx">     while (1) {
</span><span class="cx">         if (m_isAllocatingPages) {
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::scavengeXSmallPages(std::unique_lock&lt;Mutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</del><ins>+void Heap::scavengeXSmallPages(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</ins><span class="cx"> {
</span><span class="cx">     while (1) {
</span><span class="cx">         if (m_isAllocatingPages) {
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::scavengeMediumPages(std::unique_lock&lt;Mutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</del><ins>+void Heap::scavengeMediumPages(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</ins><span class="cx"> {
</span><span class="cx">     while (1) {
</span><span class="cx">         if (m_isAllocatingPages) {
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::scavengeLargeRanges(std::unique_lock&lt;Mutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</del><ins>+void Heap::scavengeLargeRanges(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</ins><span class="cx"> {
</span><span class="cx">     while (1) {
</span><span class="cx">         if (m_isAllocatingPages) {
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-XSmallLine* Heap::allocateXSmallLineSlowCase(std::lock_guard&lt;Mutex&gt;&amp; lock)
</del><ins>+XSmallLine* Heap::allocateXSmallLineSlowCase(std::lock_guard&lt;StaticMutex&gt;&amp; lock)
</ins><span class="cx"> {
</span><span class="cx">     m_isAllocatingPages = true;
</span><span class="cx"> 
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">     return line;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SmallLine* Heap::allocateSmallLineSlowCase(std::lock_guard&lt;Mutex&gt;&amp; lock)
</del><ins>+SmallLine* Heap::allocateSmallLineSlowCase(std::lock_guard&lt;StaticMutex&gt;&amp; lock)
</ins><span class="cx"> {
</span><span class="cx">     m_isAllocatingPages = true;
</span><span class="cx"> 
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">     return line;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-MediumLine* Heap::allocateMediumLineSlowCase(std::lock_guard&lt;Mutex&gt;&amp; lock)
</del><ins>+MediumLine* Heap::allocateMediumLineSlowCase(std::lock_guard&lt;StaticMutex&gt;&amp; lock)
</ins><span class="cx"> {
</span><span class="cx">     m_isAllocatingPages = true;
</span><span class="cx"> 
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">     return line;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void* Heap::allocateXLarge(std::lock_guard&lt;Mutex&gt;&amp;, size_t size)
</del><ins>+void* Heap::allocateXLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, size_t size)
</ins><span class="cx"> {
</span><span class="cx">     XLargeChunk* chunk = XLargeChunk::create(size);
</span><span class="cx"> 
</span><span class="lines">@@ -209,13 +209,13 @@
</span><span class="cx">     return chunk-&gt;begin();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::deallocateXLarge(std::lock_guard&lt;Mutex&gt;&amp;, void* object)
</del><ins>+void Heap::deallocateXLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, void* object)
</ins><span class="cx"> {
</span><span class="cx">     XLargeChunk* chunk = XLargeChunk::get(object);
</span><span class="cx">     XLargeChunk::destroy(chunk);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void* Heap::allocateLarge(std::lock_guard&lt;Mutex&gt;&amp;, size_t size)
</del><ins>+void* Heap::allocateLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, size_t size)
</ins><span class="cx"> {
</span><span class="cx">     BASSERT(size &lt;= largeMax);
</span><span class="cx">     BASSERT(size &gt;= largeMin);
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">     return range.begin();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::deallocateLarge(std::lock_guard&lt;Mutex&gt;&amp;, void* object)
</del><ins>+void Heap::deallocateLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, void* object)
</ins><span class="cx"> {
</span><span class="cx">     Range range = BoundaryTag::deallocate(object);
</span><span class="cx">     m_largeRanges.insert(range);
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Heap.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Heap.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Heap.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -44,31 +44,31 @@
</span><span class="cx"> 
</span><span class="cx"> class Heap {
</span><span class="cx"> public:
</span><del>-    Heap(std::lock_guard&lt;Mutex&gt;&amp;);
</del><ins>+    Heap(std::lock_guard&lt;StaticMutex&gt;&amp;);
</ins><span class="cx">     
</span><del>-    XSmallLine* allocateXSmallLine(std::lock_guard&lt;Mutex&gt;&amp;);
-    void deallocateXSmallLine(std::lock_guard&lt;Mutex&gt;&amp;, XSmallLine*);
</del><ins>+    XSmallLine* allocateXSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    void deallocateXSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp;, XSmallLine*);
</ins><span class="cx"> 
</span><del>-    SmallLine* allocateSmallLine(std::lock_guard&lt;Mutex&gt;&amp;);
-    void deallocateSmallLine(std::lock_guard&lt;Mutex&gt;&amp;, SmallLine*);
</del><ins>+    SmallLine* allocateSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    void deallocateSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp;, SmallLine*);
</ins><span class="cx"> 
</span><del>-    MediumLine* allocateMediumLine(std::lock_guard&lt;Mutex&gt;&amp;);
-    void deallocateMediumLine(std::lock_guard&lt;Mutex&gt;&amp;, MediumLine*);
</del><ins>+    MediumLine* allocateMediumLine(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    void deallocateMediumLine(std::lock_guard&lt;StaticMutex&gt;&amp;, MediumLine*);
</ins><span class="cx">     
</span><del>-    void* allocateLarge(std::lock_guard&lt;Mutex&gt;&amp;, size_t);
-    void deallocateLarge(std::lock_guard&lt;Mutex&gt;&amp;, void*);
</del><ins>+    void* allocateLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, size_t);
+    void deallocateLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, void*);
</ins><span class="cx"> 
</span><del>-    void* allocateXLarge(std::lock_guard&lt;Mutex&gt;&amp;, size_t);
-    void deallocateXLarge(std::lock_guard&lt;Mutex&gt;&amp;, void*);
</del><ins>+    void* allocateXLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, size_t);
+    void deallocateXLarge(std::lock_guard&lt;StaticMutex&gt;&amp;, void*);
</ins><span class="cx"> 
</span><del>-    void scavenge(std::unique_lock&lt;Mutex&gt;&amp;, std::chrono::milliseconds sleepDuration);
</del><ins>+    void scavenge(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds sleepDuration);
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     ~Heap() = delete;
</span><span class="cx"> 
</span><del>-    XSmallLine* allocateXSmallLineSlowCase(std::lock_guard&lt;Mutex&gt;&amp;);
-    SmallLine* allocateSmallLineSlowCase(std::lock_guard&lt;Mutex&gt;&amp;);
-    MediumLine* allocateMediumLineSlowCase(std::lock_guard&lt;Mutex&gt;&amp;);
</del><ins>+    XSmallLine* allocateXSmallLineSlowCase(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    SmallLine* allocateSmallLineSlowCase(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    MediumLine* allocateMediumLineSlowCase(std::lock_guard&lt;StaticMutex&gt;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void* allocateLarge(Range, size_t);
</span><span class="cx">     Range allocateLargeChunk();
</span><span class="lines">@@ -79,10 +79,10 @@
</span><span class="cx">     void mergeLargeRight(EndTag*&amp;, BeginTag*&amp;, Range&amp;, bool&amp; hasPhysicalPages);
</span><span class="cx">     
</span><span class="cx">     void concurrentScavenge();
</span><del>-    void scavengeXSmallPages(std::unique_lock&lt;Mutex&gt;&amp;, std::chrono::milliseconds);
-    void scavengeSmallPages(std::unique_lock&lt;Mutex&gt;&amp;, std::chrono::milliseconds);
-    void scavengeMediumPages(std::unique_lock&lt;Mutex&gt;&amp;, std::chrono::milliseconds);
-    void scavengeLargeRanges(std::unique_lock&lt;Mutex&gt;&amp;, std::chrono::milliseconds);
</del><ins>+    void scavengeXSmallPages(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
+    void scavengeSmallPages(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
+    void scavengeMediumPages(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
+    void scavengeLargeRanges(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;XSmallLine*&gt; m_xSmallLines;
</span><span class="cx">     Vector&lt;SmallLine*&gt; m_smallLines;
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     AsyncTask&lt;Heap, decltype(&amp;Heap::concurrentScavenge)&gt; m_scavenger;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline void Heap::deallocateXSmallLine(std::lock_guard&lt;Mutex&gt;&amp; lock, XSmallLine* line)
</del><ins>+inline void Heap::deallocateXSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock, XSmallLine* line)
</ins><span class="cx"> {
</span><span class="cx">     XSmallPage* page = XSmallPage::get(line);
</span><span class="cx">     if (page-&gt;deref(lock)) {
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     m_xSmallLines.push(line);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline XSmallLine* Heap::allocateXSmallLine(std::lock_guard&lt;Mutex&gt;&amp; lock)
</del><ins>+inline XSmallLine* Heap::allocateXSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock)
</ins><span class="cx"> {
</span><span class="cx">     while (m_xSmallLines.size()) {
</span><span class="cx">         XSmallLine* line = m_xSmallLines.pop();
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">     return allocateXSmallLineSlowCase(lock);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void Heap::deallocateSmallLine(std::lock_guard&lt;Mutex&gt;&amp; lock, SmallLine* line)
</del><ins>+inline void Heap::deallocateSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock, SmallLine* line)
</ins><span class="cx"> {
</span><span class="cx">     SmallPage* page = SmallPage::get(line);
</span><span class="cx">     if (page-&gt;deref(lock)) {
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">     m_smallLines.push(line);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline SmallLine* Heap::allocateSmallLine(std::lock_guard&lt;Mutex&gt;&amp; lock)
</del><ins>+inline SmallLine* Heap::allocateSmallLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock)
</ins><span class="cx"> {
</span><span class="cx">     while (m_smallLines.size()) {
</span><span class="cx">         SmallLine* line = m_smallLines.pop();
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">     return allocateSmallLineSlowCase(lock);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void Heap::deallocateMediumLine(std::lock_guard&lt;Mutex&gt;&amp; lock, MediumLine* line)
</del><ins>+inline void Heap::deallocateMediumLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock, MediumLine* line)
</ins><span class="cx"> {
</span><span class="cx">     MediumPage* page = MediumPage::get(line);
</span><span class="cx">     if (page-&gt;deref(lock)) {
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">     m_mediumLines.push(line);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline MediumLine* Heap::allocateMediumLine(std::lock_guard&lt;Mutex&gt;&amp; lock)
</del><ins>+inline MediumLine* Heap::allocateMediumLine(std::lock_guard&lt;StaticMutex&gt;&amp; lock)
</ins><span class="cx"> {
</span><span class="cx">     while (m_mediumLines.size()) {
</span><span class="cx">         MediumLine* line = m_mediumLines.pop();
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocLineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Line.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Line.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Line.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     static Line* get(void*);
</span><span class="cx"> 
</span><span class="cx">     void concurrentRef(unsigned char = 1);
</span><del>-    bool deref(std::lock_guard&lt;Mutex&gt;&amp;, unsigned char = 1);
</del><ins>+    bool deref(std::lock_guard&lt;StaticMutex&gt;&amp;, unsigned char = 1);
</ins><span class="cx">     
</span><span class="cx">     char* begin();
</span><span class="cx">     char* end();
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;class Traits&gt;
</span><del>-inline bool Line&lt;Traits&gt;::deref(std::lock_guard&lt;Mutex&gt;&amp;, unsigned char count)
</del><ins>+inline bool Line&lt;Traits&gt;::deref(std::lock_guard&lt;StaticMutex&gt;&amp;, unsigned char count)
</ins><span class="cx"> {
</span><span class="cx">     BASSERT(count &lt;= m_refCount);
</span><span class="cx">     m_refCount -= count;
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocMutexcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/bmalloc/bmalloc/Mutex.cpp (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Mutex.cpp        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Mutex.cpp        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;Mutex.h&quot;
-#include &lt;thread&gt;
-
-namespace bmalloc {
-
-void Mutex::lockSlowCase()
-{
-    while (!try_lock())
-        std::this_thread::yield();
-}
-
-} // namespace bmalloc
</del></span></pre></div>
<a id="trunkSourcebmallocbmallocMutexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Mutex.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Mutex.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Mutex.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -26,48 +26,22 @@
</span><span class="cx"> #ifndef Mutex_h
</span><span class="cx"> #define Mutex_h
</span><span class="cx"> 
</span><del>-#include &quot;BAssert.h&quot;
-#include &lt;atomic&gt;
</del><ins>+#include &quot;StaticMutex.h&quot;
</ins><span class="cx"> 
</span><del>-// A replacement for std::mutex that does not require an exit-time destructor.
</del><ins>+// A fast replacement for std::mutex.
</ins><span class="cx"> 
</span><span class="cx"> namespace bmalloc {
</span><span class="cx"> 
</span><del>-struct Mutex {
</del><ins>+class Mutex : public StaticMutex {
</ins><span class="cx"> public:
</span><del>-    void init();
-
-    void lock();
-    bool try_lock();
-    void unlock();
-    
-private:
-    void lockSlowCase();
-
-    std::atomic_flag m_flag;
</del><ins>+    Mutex();
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline void Mutex::init()
</del><ins>+inline Mutex::Mutex()
</ins><span class="cx"> {
</span><del>-    m_flag.clear();
</del><ins>+    init();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline bool Mutex::try_lock()
-{
-    return !m_flag.test_and_set(std::memory_order_acquire);
-}
-
-inline void Mutex::lock()
-{
-    if (!try_lock())
-        lockSlowCase();
-}
-
-inline void Mutex::unlock()
-{
-    m_flag.clear(std::memory_order_release);
-}
-
</del><span class="cx"> } // namespace bmalloc
</span><span class="cx"> 
</span><span class="cx"> #endif // Mutex_h
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/Page.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/Page.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/Page.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -45,9 +45,9 @@
</span><span class="cx">     
</span><span class="cx">     static Page* get(Line*);
</span><span class="cx"> 
</span><del>-    void ref(std::lock_guard&lt;Mutex&gt;&amp;);
-    bool deref(std::lock_guard&lt;Mutex&gt;&amp;);
-    unsigned refCount(std::lock_guard&lt;Mutex&gt;&amp;);
</del><ins>+    void ref(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    bool deref(std::lock_guard&lt;StaticMutex&gt;&amp;);
+    unsigned refCount(std::lock_guard&lt;StaticMutex&gt;&amp;);
</ins><span class="cx">     
</span><span class="cx">     Line* begin();
</span><span class="cx">     Line* end();
</span><span class="lines">@@ -57,14 +57,14 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Traits&gt;
</span><del>-inline void Page&lt;Traits&gt;::ref(std::lock_guard&lt;Mutex&gt;&amp;)
</del><ins>+inline void Page&lt;Traits&gt;::ref(std::lock_guard&lt;StaticMutex&gt;&amp;)
</ins><span class="cx"> {
</span><span class="cx">     BASSERT(m_refCount &lt; maxRefCount);
</span><span class="cx">     ++m_refCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Traits&gt;
</span><del>-inline bool Page&lt;Traits&gt;::deref(std::lock_guard&lt;Mutex&gt;&amp;)
</del><ins>+inline bool Page&lt;Traits&gt;::deref(std::lock_guard&lt;StaticMutex&gt;&amp;)
</ins><span class="cx"> {
</span><span class="cx">     BASSERT(m_refCount);
</span><span class="cx">     --m_refCount;
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Traits&gt;
</span><del>-inline unsigned Page&lt;Traits&gt;::refCount(std::lock_guard&lt;Mutex&gt;&amp;)
</del><ins>+inline unsigned Page&lt;Traits&gt;::refCount(std::lock_guard&lt;StaticMutex&gt;&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return m_refCount;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocPerProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/PerProcess.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/PerProcess.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/PerProcess.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx"> #define PerProcess_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Inline.h&quot;
</span><del>-#include &quot;Mutex.h&quot;
</del><span class="cx"> #include &quot;Sizes.h&quot;
</span><ins>+#include &quot;StaticMutex.h&quot;
</ins><span class="cx"> #include &lt;mutex&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace bmalloc {
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> // x = object-&gt;m_field; // OK
</span><span class="cx"> // if (gobalFlag) { ... } // Undefined behavior.
</span><span class="cx"> //
</span><del>-// std::lock_guard&lt;Mutex&gt; lock(PerProcess&lt;Object&gt;::mutex());
</del><ins>+// std::lock_guard&lt;StaticMutex&gt; lock(PerProcess&lt;Object&gt;::mutex());
</ins><span class="cx"> // Object* object = PerProcess&lt;Object&gt;::get(lock);
</span><span class="cx"> // if (gobalFlag) { ... } // OK.
</span><span class="cx"> 
</span><span class="lines">@@ -58,13 +58,13 @@
</span><span class="cx">     static T* get();
</span><span class="cx">     static T* getFastCase();
</span><span class="cx">     
</span><del>-    static Mutex&amp; mutex() { return s_mutex; }
</del><ins>+    static StaticMutex&amp; mutex() { return s_mutex; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     static T* getSlowCase();
</span><span class="cx"> 
</span><span class="cx">     static std::atomic&lt;T*&gt; s_object;
</span><del>-    static Mutex s_mutex;
</del><ins>+    static StaticMutex s_mutex;
</ins><span class="cx"> 
</span><span class="cx">     typedef typename std::aligned_storage&lt;sizeof(T), std::alignment_of&lt;T&gt;::value&gt;::type Memory;
</span><span class="cx">     static Memory s_memory;
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> template&lt;typename T&gt;
</span><span class="cx"> NO_INLINE T* PerProcess&lt;T&gt;::getSlowCase()
</span><span class="cx"> {
</span><del>-    std::lock_guard&lt;Mutex&gt; lock(s_mutex);
</del><ins>+    std::lock_guard&lt;StaticMutex&gt; lock(s_mutex);
</ins><span class="cx">     if (!s_object.load(std::memory_order_consume)) {
</span><span class="cx">         T* t = new (&amp;s_memory) T(lock);
</span><span class="cx">         s_object.store(t, std::memory_order_release);
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> std::atomic&lt;T*&gt; PerProcess&lt;T&gt;::s_object;
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><del>-Mutex PerProcess&lt;T&gt;::s_mutex;
</del><ins>+StaticMutex PerProcess&lt;T&gt;::s_mutex;
</ins><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span><span class="cx"> typename PerProcess&lt;T&gt;::Memory PerProcess&lt;T&gt;::s_memory;
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocStaticMutexcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/bmalloc/bmalloc/StaticMutex.cpp (0 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/StaticMutex.cpp                                (rev 0)
+++ trunk/Source/bmalloc/bmalloc/StaticMutex.cpp        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;StaticMutex.h&quot;
+#include &lt;thread&gt;
+
+namespace bmalloc {
+
+void StaticMutex::lockSlowCase()
+{
+    while (!try_lock())
+        std::this_thread::yield();
+}
+
+} // namespace bmalloc
</ins></span></pre></div>
<a id="trunkSourcebmallocbmallocStaticMutexh"></a>
<div class="addfile"><h4>Added: trunk/Source/bmalloc/bmalloc/StaticMutex.h (0 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/StaticMutex.h                                (rev 0)
+++ trunk/Source/bmalloc/bmalloc/StaticMutex.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef StaticMutex_h
+#define StaticMutex_h
+
+#include &quot;BAssert.h&quot;
+#include &lt;atomic&gt;
+
+// A fast replacement for std::mutex for use in static storage, where global
+// constructors and exit-time destructors are prohibited.
+
+namespace bmalloc {
+
+class StaticMutex {
+public:
+    void lock();
+    bool try_lock();
+    void unlock();
+
+private:
+    friend class Mutex;
+
+    // Static storage will zero-initialize us automatically, but Mutex needs an
+    // API for explicit initialization.
+    void init();
+
+    void lockSlowCase();
+
+    std::atomic_flag m_flag;
+};
+
+inline void StaticMutex::init()
+{
+    m_flag.clear();
+}
+
+inline bool StaticMutex::try_lock()
+{
+    return !m_flag.test_and_set(std::memory_order_acquire);
+}
+
+inline void StaticMutex::lock()
+{
+    if (!try_lock())
+        lockSlowCase();
+}
+
+inline void StaticMutex::unlock()
+{
+    m_flag.clear(std::memory_order_release);
+}
+
+} // namespace bmalloc
+
+#endif // StaticMutex_h
</ins></span></pre></div>
<a id="trunkSourcebmallocbmallocVMHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/VMHeap.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/VMHeap.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/VMHeap.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -51,10 +51,10 @@
</span><span class="cx">     MediumPage* allocateMediumPage();
</span><span class="cx">     Range allocateLargeRange(size_t);
</span><span class="cx"> 
</span><del>-    void deallocateXSmallPage(std::unique_lock&lt;Mutex&gt;&amp;, XSmallPage*);
-    void deallocateSmallPage(std::unique_lock&lt;Mutex&gt;&amp;, SmallPage*);
-    void deallocateMediumPage(std::unique_lock&lt;Mutex&gt;&amp;, MediumPage*);
-    void deallocateLargeRange(std::unique_lock&lt;Mutex&gt;&amp;, Range);
</del><ins>+    void deallocateXSmallPage(std::unique_lock&lt;StaticMutex&gt;&amp;, XSmallPage*);
+    void deallocateSmallPage(std::unique_lock&lt;StaticMutex&gt;&amp;, SmallPage*);
+    void deallocateMediumPage(std::unique_lock&lt;StaticMutex&gt;&amp;, MediumPage*);
+    void deallocateLargeRange(std::unique_lock&lt;StaticMutex&gt;&amp;, Range);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void allocateXSmallChunk();
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     return range;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void VMHeap::deallocateXSmallPage(std::unique_lock&lt;Mutex&gt;&amp; lock, XSmallPage* page)
</del><ins>+inline void VMHeap::deallocateXSmallPage(std::unique_lock&lt;StaticMutex&gt;&amp; lock, XSmallPage* page)
</ins><span class="cx"> {
</span><span class="cx">     lock.unlock();
</span><span class="cx">     vmDeallocatePhysicalPages(page-&gt;begin()-&gt;begin(), vmPageSize);
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     m_xSmallPages.push(page);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void VMHeap::deallocateSmallPage(std::unique_lock&lt;Mutex&gt;&amp; lock, SmallPage* page)
</del><ins>+inline void VMHeap::deallocateSmallPage(std::unique_lock&lt;StaticMutex&gt;&amp; lock, SmallPage* page)
</ins><span class="cx"> {
</span><span class="cx">     lock.unlock();
</span><span class="cx">     vmDeallocatePhysicalPages(page-&gt;begin()-&gt;begin(), vmPageSize);
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     m_smallPages.push(page);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void VMHeap::deallocateMediumPage(std::unique_lock&lt;Mutex&gt;&amp; lock, MediumPage* page)
</del><ins>+inline void VMHeap::deallocateMediumPage(std::unique_lock&lt;StaticMutex&gt;&amp; lock, MediumPage* page)
</ins><span class="cx"> {
</span><span class="cx">     lock.unlock();
</span><span class="cx">     vmDeallocatePhysicalPages(page-&gt;begin()-&gt;begin(), vmPageSize);
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">     m_mediumPages.push(page);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void VMHeap::deallocateLargeRange(std::unique_lock&lt;Mutex&gt;&amp; lock, Range range)
</del><ins>+inline void VMHeap::deallocateLargeRange(std::unique_lock&lt;StaticMutex&gt;&amp; lock, Range range)
</ins><span class="cx"> {
</span><span class="cx">     BeginTag* beginTag = LargeChunk::beginTag(range.begin());
</span><span class="cx">     EndTag* endTag = LargeChunk::endTag(range.begin(), range.size());
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocbmalloch"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc/bmalloc.h (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc/bmalloc.h        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc/bmalloc.h        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> {
</span><span class="cx">     PerThread&lt;Cache&gt;::get()-&gt;scavenge();
</span><span class="cx">     
</span><del>-    std::unique_lock&lt;Mutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</del><ins>+    std::unique_lock&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</ins><span class="cx">     PerProcess&lt;Heap&gt;::get()-&gt;scavenge(lock, std::chrono::milliseconds(0));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourcebmallocbmallocxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj (167539 => 167540)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj        2014-04-19 18:12:39 UTC (rev 167539)
+++ trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj        2014-04-19 18:36:56 UTC (rev 167540)
</span><span class="lines">@@ -16,6 +16,8 @@
</span><span class="cx">                 142FCC7A190080B8009032D4 /* XSmallPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 142FCC76190080B8009032D4 /* XSmallPage.h */; };
</span><span class="cx">                 142FCC7B190080B8009032D4 /* XSmallTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 142FCC77190080B8009032D4 /* XSmallTraits.h */; };
</span><span class="cx">                 142FCC7D1900815E009032D4 /* XSmallAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 142FCC7C1900815E009032D4 /* XSmallAllocator.h */; };
</span><ins>+                143CB81C19022BC900B16A45 /* StaticMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143CB81A19022BC900B16A45 /* StaticMutex.cpp */; };
+                143CB81D19022BC900B16A45 /* StaticMutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 143CB81B19022BC900B16A45 /* StaticMutex.h */; };
</ins><span class="cx">                 1448C30018F3754600502839 /* mbmalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1448C2FF18F3754300502839 /* mbmalloc.cpp */; };
</span><span class="cx">                 1448C30118F3754C00502839 /* bmalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1448C2FE18F3754300502839 /* bmalloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 14C919C918FCC59F0028DB43 /* BPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 14C919C818FCC59F0028DB43 /* BPlatform.h */; };
</span><span class="lines">@@ -62,7 +64,6 @@
</span><span class="cx">                 14F271C718EA3990008C152F /* Heap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA320E18875D9F007269E0 /* Heap.cpp */; };
</span><span class="cx">                 14F271C818EA3990008C152F /* ObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14105E8318E14374003A106E /* ObjectType.cpp */; };
</span><span class="cx">                 14F271C918EA3990008C152F /* VMHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144F7BFB18BFC517003537F3 /* VMHeap.cpp */; };
</span><del>-                14F271CA18EA3990008C152F /* Mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144DCED817A728570093B2F2 /* Mutex.cpp */; };
</del><span class="cx"> /* End PBXBuildFile section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXContainerItemProxy section */
</span><span class="lines">@@ -92,6 +93,8 @@
</span><span class="cx">                 142FCC76190080B8009032D4 /* XSmallPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XSmallPage.h; path = bmalloc/XSmallPage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 142FCC77190080B8009032D4 /* XSmallTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XSmallTraits.h; path = bmalloc/XSmallTraits.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 142FCC7C1900815E009032D4 /* XSmallAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XSmallAllocator.h; path = bmalloc/XSmallAllocator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                143CB81A19022BC900B16A45 /* StaticMutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StaticMutex.cpp; path = bmalloc/StaticMutex.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                143CB81B19022BC900B16A45 /* StaticMutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StaticMutex.h; path = bmalloc/StaticMutex.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 143E29E918CAE8BE00FE8A0F /* MediumPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediumPage.h; path = bmalloc/MediumPage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 143E29ED18CAE90500FE8A0F /* SmallPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmallPage.h; path = bmalloc/SmallPage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 144469E417A46BFE00F9EA1D /* Cache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = Cache.cpp; path = bmalloc/Cache.cpp; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
</span><span class="lines">@@ -101,7 +104,6 @@
</span><span class="cx">                 1448C2FE18F3754300502839 /* bmalloc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = bmalloc.h; path = bmalloc/bmalloc.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1448C2FF18F3754300502839 /* mbmalloc.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = mbmalloc.cpp; path = bmalloc/mbmalloc.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 144DCED617A649D90093B2F2 /* Mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mutex.h; path = bmalloc/Mutex.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                144DCED817A728570093B2F2 /* Mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mutex.cpp; path = bmalloc/Mutex.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 144F7BFB18BFC517003537F3 /* VMHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VMHeap.cpp; path = bmalloc/VMHeap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 144F7BFC18BFC517003537F3 /* VMHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VMHeap.h; path = bmalloc/VMHeap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1452478518BC757C00F80098 /* MediumLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediumLine.h; path = bmalloc/MediumLine.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -279,11 +281,12 @@
</span><span class="cx">                                 14C919C818FCC59F0028DB43 /* BPlatform.h */,
</span><span class="cx">                                 14D9DB4517F2447100EAAB79 /* FixedVector.h */,
</span><span class="cx">                                 1413E460189DCE1E00546D68 /* Inline.h */,
</span><del>-                                144DCED817A728570093B2F2 /* Mutex.cpp */,
</del><span class="cx">                                 144DCED617A649D90093B2F2 /* Mutex.h */,
</span><span class="cx">                                 14446A0717A61FA400F9EA1D /* PerProcess.h */,
</span><span class="cx">                                 144469FD17A61F1F00F9EA1D /* PerThread.h */,
</span><span class="cx">                                 145F6878179E3A4400D65598 /* Range.h */,
</span><ins>+                                143CB81A19022BC900B16A45 /* StaticMutex.cpp */,
+                                143CB81B19022BC900B16A45 /* StaticMutex.h */,
</ins><span class="cx">                                 1417F64F18B7280C0076FA3F /* Syscall.h */,
</span><span class="cx">                                 1479E21217A1A255006D4E9D /* Vector.h */,
</span><span class="cx">                                 1479E21417A1A63E006D4E9D /* VMAllocate.h */,
</span><span class="lines">@@ -315,6 +318,7 @@
</span><span class="cx">                                 14DD78B418F48D6B00950702 /* Chunk.h in Headers */,
</span><span class="cx">                                 14DD78CA18F48D7500950702 /* Mutex.h in Headers */,
</span><span class="cx">                                 142FCC7D1900815E009032D4 /* XSmallAllocator.h in Headers */,
</span><ins>+                                143CB81D19022BC900B16A45 /* StaticMutex.h in Headers */,
</ins><span class="cx">                                 14DD78D118F48EC600950702 /* XLargeChunk.h in Headers */,
</span><span class="cx">                                 14DD78B918F48D6B00950702 /* MediumTraits.h in Headers */,
</span><span class="cx">                                 1448C30118F3754C00502839 /* bmalloc.h in Headers */,
</span><span class="lines">@@ -432,7 +436,7 @@
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><del>-                                14F271CA18EA3990008C152F /* Mutex.cpp in Sources */,
</del><ins>+                                143CB81C19022BC900B16A45 /* StaticMutex.cpp in Sources */,
</ins><span class="cx">                                 14F271C618EA3983008C152F /* SegregatedFreeList.cpp in Sources */,
</span><span class="cx">                                 14F271C318EA3978008C152F /* Allocator.cpp in Sources */,
</span><span class="cx">                                 14F271C718EA3990008C152F /* Heap.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>