2011-02-03 Geoffrey Garen <ggaren@apple.com>
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 00:27:37 +0000 (00:27 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 00:27:37 +0000 (00:27 +0000)
        Reviewed by Oliver Hunt.

        Not all blocks are freed when the heap is freed (counting is hard!)
        https://bugs.webkit.org/show_bug.cgi?id=53732

        * runtime/MarkedSpace.cpp:
        (JSC::MarkedSpace::destroy): Freeing a block compacts the list, so just
        keep freeing block 0 until there are no blocks left.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@77557 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/MarkedSpace.cpp

index e354bf0..bd139bb 100644 (file)
@@ -1,5 +1,16 @@
 2011-02-03  Geoffrey Garen  <ggaren@apple.com>
 
+        Reviewed by Oliver Hunt.
+
+        Not all blocks are freed when the heap is freed (counting is hard!)
+        https://bugs.webkit.org/show_bug.cgi?id=53732
+
+        * runtime/MarkedSpace.cpp:
+        (JSC::MarkedSpace::destroy): Freeing a block compacts the list, so just
+        keep freeing block 0 until there are no blocks left.
+
+2011-02-03  Geoffrey Garen  <ggaren@apple.com>
+
         Try to fix the Mac build.
 
         * JavaScriptCore.xcodeproj/project.pbxproj: The new MarkedBlock.h header
index 5dd9364..027a973 100644 (file)
@@ -52,8 +52,8 @@ void MarkedSpace::destroy()
 {
     clearMarkBits(); // Make sure weak pointers appear dead during destruction.
 
-    for (size_t block = 0; block < m_heap.usedBlocks; ++block)
-        freeBlock(block);
+    while (m_heap.usedBlocks)
+        freeBlock(0);
     fastFree(m_heap.blocks);
 
     memset(&m_heap, 0, sizeof(CollectorHeap));