Changeset 252519 in webkit


Ignore:
Timestamp:
Nov 15, 2019 6:34:32 PM (4 years ago)
Author:
basuke.suzuki@sony.com
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):

Location:
trunk/Source/bmalloc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r252518 r252519  
     12019-11-15  Basuke Suzuki  <basuke.suzuki@sony.com>
     2
     3        [bmalloc] The tracking of freeableMemory of Heap doesn't count Chunk's metadata size.
     4        https://bugs.webkit.org/show_bug.cgi?id=204135
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        When chunk is allocated in allocateSmallChunk(), all chunk size is added to freeableMemory.
     9        This is wrong. Only free pages should be added to it.
     10
     11        * bmalloc/Heap.cpp:
     12        (bmalloc::Heap::allocateSmallChunk):
     13
    1142019-11-15  Basuke Suzuki  <basuke.suzuki@sony.com>
    215
  • trunk/Source/bmalloc/bmalloc/Heap.cpp

    r252518 r252519  
    275275        m_objectTypes.set(chunk, ObjectType::Small);
    276276
     277        size_t accountedInFreeable = 0;
    277278        forEachPage(chunk, pageSize, [&](SmallPage* page) {
    278279            page->setHasPhysicalPages(true);
     
    282283            page->setHasFreeLines(lock, true);
    283284            chunk->freePages().push(page);
     285            accountedInFreeable += pageSize;
    284286        });
    285287
    286         m_freeableMemory += chunkSize;
     288        m_freeableMemory += accountedInFreeable;
    287289       
    288290        m_scavenger->schedule(0);
Note: See TracChangeset for help on using the changeset viewer.