Title: [252519] trunk/Source/bmalloc
Revision
252519
Author
[email protected]
Date
2019-11-15 18:34:32 -0800 (Fri, 15 Nov 2019)

Log Message

[bmalloc] The tracking of freeableMemory of Heap doesn't count Chunk's metadata size.
https://bugs.webkit.org/show_bug.cgi?id=204135

Reviewed by Yusuke Suzuki.

When chunk is allocated in allocateSmallChunk(), all chunk size is added to freeableMemory.
This is wrong. Only free pages should be added to it.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallChunk):

Modified Paths

Diff

Modified: trunk/Source/bmalloc/ChangeLog (252518 => 252519)


--- trunk/Source/bmalloc/ChangeLog	2019-11-16 02:32:40 UTC (rev 252518)
+++ trunk/Source/bmalloc/ChangeLog	2019-11-16 02:34:32 UTC (rev 252519)
@@ -1,5 +1,18 @@
 2019-11-15  Basuke Suzuki  <[email protected]>
 
+        [bmalloc] The tracking of freeableMemory of Heap doesn't count Chunk's metadata size.
+        https://bugs.webkit.org/show_bug.cgi?id=204135
+
+        Reviewed by Yusuke Suzuki.
+
+        When chunk is allocated in allocateSmallChunk(), all chunk size is added to freeableMemory.
+        This is wrong. Only free pages should be added to it.
+
+        * bmalloc/Heap.cpp:
+        (bmalloc::Heap::allocateSmallChunk):
+
+2019-11-15  Basuke Suzuki  <[email protected]>
+
         [Mac] Use better describing name for Mac's scavenger compiler flag.
         https://bugs.webkit.org/show_bug.cgi?id=203922
 

Modified: trunk/Source/bmalloc/bmalloc/Heap.cpp (252518 => 252519)


--- trunk/Source/bmalloc/bmalloc/Heap.cpp	2019-11-16 02:32:40 UTC (rev 252518)
+++ trunk/Source/bmalloc/bmalloc/Heap.cpp	2019-11-16 02:34:32 UTC (rev 252519)
@@ -274,6 +274,7 @@
 
         m_objectTypes.set(chunk, ObjectType::Small);
 
+        size_t accountedInFreeable = 0;
         forEachPage(chunk, pageSize, [&](SmallPage* page) {
             page->setHasPhysicalPages(true);
 #if !BUSE(PARTIAL_SCAVENGE)
@@ -281,9 +282,10 @@
 #endif
             page->setHasFreeLines(lock, true);
             chunk->freePages().push(page);
+            accountedInFreeable += pageSize;
         });
 
-        m_freeableMemory += chunkSize;
+        m_freeableMemory += accountedInFreeable;
         
         m_scavenger->schedule(0);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to