<!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>[181224] releases/WebKitGTK/webkit-2.8/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/181224">181224</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-08 00:47:22 -0800 (Sun, 08 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/180953">r180953</a> - bmalloc: Miscellaneous cleanup
https://bugs.webkit.org/show_bug.cgi?id=142231

Reviewed by Andreas Kling.

No performance change -- maybe a tiny reduction in memory use.

* bmalloc/Heap.cpp: Moved the sleep function into StaticMutex, since
it's a helper for working with mutexes.

(bmalloc::Heap::scavenge): Make sure to wait before we start any
scavenging, since individual scavenging functions now always scavenge
at least one page before waiting themselves.

(bmalloc::Heap::scavengeSmallPages):
(bmalloc::Heap::scavengeMediumPages):
(bmalloc::Heap::scavengeLargeObjects): Use the new wait helper to
simplify this code. Also, we now require our caller to wait until at
least one deallocation is desirable. This simplifies our loop.

(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::allocateMediumPage):
(bmalloc::Heap::allocateXLarge):
(bmalloc::Heap::allocateLarge): Don't freak out any time the heap does
an allocation. Only consider the heap to be growing if it actually needs
to allocate new VM. This allows us to shrink the heap back down from a
high water mark more reliably even if heap activity continues.

(bmalloc::sleep): Deleted.
(bmalloc::Heap::scavengeLargeRanges): Renamed to match our use of
&quot;LargeObject&quot;.

* bmalloc/Heap.h:

* bmalloc/LargeObject.h:
(bmalloc::LargeObject::operator bool): Added to simplify a while loop.

* bmalloc/StaticMutex.h:
(bmalloc::sleep):
(bmalloc::waitUntilFalse): New helper for waiting until a condition
becomes reliably false.

* bmalloc/Vector.h:
(bmalloc::Vector&lt;T&gt;::~Vector): Oops! Don't deallocate the null pointer.
We don't actually run any Vector destructors, but an iteration of this
patch did, and then crashed. So, let's fix that.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28SourcebmallocChangeLog">releases/WebKitGTK/webkit-2.8/Source/bmalloc/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourcebmallocbmallocHeapcpp">releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourcebmallocbmallocHeaph">releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourcebmallocbmallocLargeObjecth">releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/LargeObject.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourcebmallocbmallocStaticMutexh">releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/StaticMutex.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourcebmallocbmallocVectorh">releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Vector.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28SourcebmallocChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/bmalloc/ChangeLog (181223 => 181224)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/bmalloc/ChangeLog        2015-03-08 08:20:10 UTC (rev 181223)
+++ releases/WebKitGTK/webkit-2.8/Source/bmalloc/ChangeLog        2015-03-08 08:47:22 UTC (rev 181224)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-03-03  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        bmalloc: Miscellaneous cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=142231
+
+        Reviewed by Andreas Kling.
+
+        No performance change -- maybe a tiny reduction in memory use.
+
+        * bmalloc/Heap.cpp: Moved the sleep function into StaticMutex, since
+        it's a helper for working with mutexes.
+
+        (bmalloc::Heap::scavenge): Make sure to wait before we start any
+        scavenging, since individual scavenging functions now always scavenge
+        at least one page before waiting themselves.
+
+        (bmalloc::Heap::scavengeSmallPages):
+        (bmalloc::Heap::scavengeMediumPages):
+        (bmalloc::Heap::scavengeLargeObjects): Use the new wait helper to
+        simplify this code. Also, we now require our caller to wait until at
+        least one deallocation is desirable. This simplifies our loop.
+
+        (bmalloc::Heap::allocateSmallPage):
+        (bmalloc::Heap::allocateMediumPage):
+        (bmalloc::Heap::allocateXLarge):
+        (bmalloc::Heap::allocateLarge): Don't freak out any time the heap does
+        an allocation. Only consider the heap to be growing if it actually needs
+        to allocate new VM. This allows us to shrink the heap back down from a
+        high water mark more reliably even if heap activity continues.
+
+        (bmalloc::sleep): Deleted.
+        (bmalloc::Heap::scavengeLargeRanges): Renamed to match our use of
+        &quot;LargeObject&quot;.
+
+        * bmalloc/Heap.h:
+
+        * bmalloc/LargeObject.h:
+        (bmalloc::LargeObject::operator bool): Added to simplify a while loop.
+
+        * bmalloc/StaticMutex.h:
+        (bmalloc::sleep):
+        (bmalloc::waitUntilFalse): New helper for waiting until a condition
+        becomes reliably false.
+
+        * bmalloc/Vector.h:
+        (bmalloc::Vector&lt;T&gt;::~Vector): Oops! Don't deallocate the null pointer.
+        We don't actually run any Vector destructors, but an iteration of this
+        patch did, and then crashed. So, let's fix that.
+
</ins><span class="cx"> 2015-03-02  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         bmalloc: Eagerly remove allocated objects from the free list
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourcebmallocbmallocHeapcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.cpp (181223 => 181224)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.cpp        2015-03-08 08:20:10 UTC (rev 181223)
+++ releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.cpp        2015-03-08 08:47:22 UTC (rev 181224)
</span><span class="lines">@@ -35,16 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace bmalloc {
</span><span class="cx"> 
</span><del>-static inline void sleep(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds duration)
-{
-    if (duration == std::chrono::milliseconds(0))
-        return;
-    
-    lock.unlock();
-    std::this_thread::sleep_for(duration);
-    lock.lock();
-}
-
</del><span class="cx"> Heap::Heap(std::lock_guard&lt;StaticMutex&gt;&amp;)
</span><span class="cx">     : m_largeObjects(Owner::Heap)
</span><span class="cx">     , m_isAllocatingPages(false)
</span><span class="lines">@@ -93,62 +83,39 @@
</span><span class="cx">     std::unique_lock&lt;StaticMutex&gt; lock(PerProcess&lt;Heap&gt;::mutex());
</span><span class="cx">     scavenge(lock, scavengeSleepDuration);
</span><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> void Heap::scavenge(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</span><span class="cx"> {
</span><ins>+    waitUntilFalse(lock, sleepDuration, m_isAllocatingPages);
+
</ins><span class="cx">     scavengeSmallPages(lock, sleepDuration);
</span><span class="cx">     scavengeMediumPages(lock, sleepDuration);
</span><del>-    scavengeLargeRanges(lock, sleepDuration);
</del><ins>+    scavengeLargeObjects(lock, sleepDuration);
</ins><span class="cx"> 
</span><span class="cx">     sleep(lock, sleepDuration);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Heap::scavengeSmallPages(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</span><span class="cx"> {
</span><del>-    while (1) {
-        if (m_isAllocatingPages) {
-            m_isAllocatingPages = false;
-
-            sleep(lock, sleepDuration);
-            continue;
-        }
-
-        if (!m_smallPages.size())
-            return;
</del><ins>+    while (m_smallPages.size()) {
</ins><span class="cx">         m_vmHeap.deallocateSmallPage(lock, m_smallPages.pop());
</span><ins>+        waitUntilFalse(lock, sleepDuration, m_isAllocatingPages);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Heap::scavengeMediumPages(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</span><span class="cx"> {
</span><del>-    while (1) {
-        if (m_isAllocatingPages) {
-            m_isAllocatingPages = false;
-
-            sleep(lock, sleepDuration);
-            continue;
-        }
-
-        if (!m_mediumPages.size())
-            return;
</del><ins>+    while (m_mediumPages.size()) {
</ins><span class="cx">         m_vmHeap.deallocateMediumPage(lock, m_mediumPages.pop());
</span><ins>+        waitUntilFalse(lock, sleepDuration, m_isAllocatingPages);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::scavengeLargeRanges(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</del><ins>+void Heap::scavengeLargeObjects(std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration)
</ins><span class="cx"> {
</span><del>-    while (1) {
-        if (m_isAllocatingPages) {
-            m_isAllocatingPages = false;
-
-            sleep(lock, sleepDuration);
-            continue;
-        }
-
-        LargeObject largeObject = m_largeObjects.takeGreedy();
-        if (!largeObject)
-            return;
</del><ins>+    while (LargeObject largeObject = m_largeObjects.takeGreedy()) {
</ins><span class="cx">         m_vmHeap.deallocateLargeObject(lock, largeObject);
</span><ins>+        waitUntilFalse(lock, sleepDuration, m_isAllocatingPages);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -235,12 +202,12 @@
</span><span class="cx">             continue;
</span><span class="cx">         return page;
</span><span class="cx">     }
</span><del>-    
-    m_isAllocatingPages = true;
</del><span class="cx"> 
</span><span class="cx">     SmallPage* page = [this, sizeClass]() {
</span><span class="cx">         if (m_smallPages.size())
</span><span class="cx">             return m_smallPages.pop();
</span><ins>+
+        m_isAllocatingPages = true;
</ins><span class="cx">         return m_vmHeap.allocateSmallPage();
</span><span class="cx">     }();
</span><span class="cx"> 
</span><span class="lines">@@ -257,12 +224,12 @@
</span><span class="cx">             continue;
</span><span class="cx">         return page;
</span><span class="cx">     }
</span><del>-    
-    m_isAllocatingPages = true;
</del><span class="cx"> 
</span><span class="cx">     MediumPage* page = [this, sizeClass]() {
</span><span class="cx">         if (m_mediumPages.size())
</span><span class="cx">             return m_mediumPages.pop();
</span><ins>+
+        m_isAllocatingPages = true;
</ins><span class="cx">         return m_vmHeap.allocateMediumPage();
</span><span class="cx">     }();
</span><span class="cx"> 
</span><span class="lines">@@ -320,8 +287,6 @@
</span><span class="cx">     BASSERT(alignment &gt;= xLargeAlignment);
</span><span class="cx">     BASSERT(size == roundUpToMultipleOf&lt;xLargeAlignment&gt;(size));
</span><span class="cx"> 
</span><del>-    m_isAllocatingPages = true;
-
</del><span class="cx">     void* result = vmAllocate(alignment, size);
</span><span class="cx">     m_xLargeObjects.push(Range(result, size));
</span><span class="cx">     return result;
</span><span class="lines">@@ -379,11 +344,11 @@
</span><span class="cx">     BASSERT(size &gt;= largeMin);
</span><span class="cx">     BASSERT(size == roundUpToMultipleOf&lt;largeAlignment&gt;(size));
</span><span class="cx">     
</span><del>-    m_isAllocatingPages = true;
-
</del><span class="cx">     LargeObject largeObject = m_largeObjects.take(size);
</span><del>-    if (!largeObject)
</del><ins>+    if (!largeObject) {
+        m_isAllocatingPages = true;
</ins><span class="cx">         largeObject = m_vmHeap.allocateLargeObject(size);
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     return allocateLarge(lock, largeObject, size);
</span><span class="cx"> }
</span><span class="lines">@@ -400,11 +365,11 @@
</span><span class="cx">     BASSERT(alignment &gt;= largeAlignment);
</span><span class="cx">     BASSERT(isPowerOfTwo(alignment));
</span><span class="cx"> 
</span><del>-    m_isAllocatingPages = true;
-
</del><span class="cx">     LargeObject largeObject = m_largeObjects.take(alignment, size, unalignedSize);
</span><del>-    if (!largeObject)
</del><ins>+    if (!largeObject) {
+        m_isAllocatingPages = true;
</ins><span class="cx">         largeObject = m_vmHeap.allocateLargeObject(alignment, size, unalignedSize);
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     size_t alignmentMask = alignment - 1;
</span><span class="cx">     if (test(largeObject.begin(), alignmentMask)) {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourcebmallocbmallocHeaph"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.h (181223 => 181224)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.h        2015-03-08 08:20:10 UTC (rev 181223)
+++ releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Heap.h        2015-03-08 08:47:22 UTC (rev 181224)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">     void concurrentScavenge();
</span><span class="cx">     void scavengeSmallPages(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
</span><span class="cx">     void scavengeMediumPages(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
</span><del>-    void scavengeLargeRanges(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
</del><ins>+    void scavengeLargeObjects(std::unique_lock&lt;StaticMutex&gt;&amp;, std::chrono::milliseconds);
</ins><span class="cx"> 
</span><span class="cx">     std::array&lt;std::array&lt;LineMetadata, SmallPage::lineCount&gt;, smallMax / alignment&gt; m_smallLineMetadata;
</span><span class="cx">     std::array&lt;std::array&lt;LineMetadata, MediumPage::lineCount&gt;, mediumMax / alignment&gt; m_mediumLineMetadata;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourcebmallocbmallocLargeObjecth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/LargeObject.h (181223 => 181224)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/LargeObject.h        2015-03-08 08:20:10 UTC (rev 181223)
+++ releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/LargeObject.h        2015-03-08 08:47:22 UTC (rev 181224)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     enum DoNotValidateTag { DoNotValidate };
</span><span class="cx">     LargeObject(DoNotValidateTag, void*);
</span><span class="cx">     
</span><ins>+    operator bool() { return !!*this; }
</ins><span class="cx">     bool operator!() { return !m_object; }
</span><span class="cx"> 
</span><span class="cx">     char* begin() const { return static_cast&lt;char*&gt;(m_object); }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourcebmallocbmallocStaticMutexh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/StaticMutex.h (181223 => 181224)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/StaticMutex.h        2015-03-08 08:20:10 UTC (rev 181223)
+++ releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/StaticMutex.h        2015-03-08 08:47:22 UTC (rev 181224)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;BAssert.h&quot;
</span><span class="cx"> #include &lt;atomic&gt;
</span><ins>+#include &lt;mutex&gt;
+#include &lt;thread&gt;
</ins><span class="cx"> 
</span><span class="cx"> // A fast replacement for std::mutex, for use in static storage.
</span><span class="cx"> 
</span><span class="lines">@@ -52,6 +54,27 @@
</span><span class="cx">     std::atomic_flag m_flag;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+static inline void sleep(
+    std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds duration)
+{
+    if (duration == std::chrono::milliseconds(0))
+        return;
+    
+    lock.unlock();
+    std::this_thread::sleep_for(duration);
+    lock.lock();
+}
+
+static inline void waitUntilFalse(
+    std::unique_lock&lt;StaticMutex&gt;&amp; lock, std::chrono::milliseconds sleepDuration,
+    bool&amp; condition)
+{
+    while (condition) {
+        condition = false;
+        sleep(lock, sleepDuration);
+    }
+}
+
</ins><span class="cx"> inline void StaticMutex::init()
</span><span class="cx"> {
</span><span class="cx">     m_flag.clear();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourcebmallocbmallocVectorh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Vector.h (181223 => 181224)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Vector.h        2015-03-08 08:20:10 UTC (rev 181223)
+++ releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Vector.h        2015-03-08 08:47:22 UTC (rev 181224)
</span><span class="lines">@@ -88,7 +88,8 @@
</span><span class="cx"> template&lt;typename T&gt;
</span><span class="cx"> Vector&lt;T&gt;::~Vector()
</span><span class="cx"> {
</span><del>-    vmDeallocate(m_buffer, vmSize(m_capacity * sizeof(T)));
</del><ins>+    if (m_buffer)
+        vmDeallocate(m_buffer, vmSize(m_capacity * sizeof(T)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span></span></pre>
</div>
</div>

</body>
</html>