Changeset 179751 in webkit


Ignore:
Timestamp:
Feb 6, 2015 12:25:05 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r179743.
https://bugs.webkit.org/show_bug.cgi?id=141335

caused missing symbols in non-WebKit clients of WTF::Vector
(Requested by kling on #webkit).

Reverted changeset:

"Remove WTF::fastMallocGoodSize()."
https://bugs.webkit.org/show_bug.cgi?id=141020
http://trac.webkit.org/changeset/179743

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r179746 r179751  
     12015-02-06  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r179743.
     4        https://bugs.webkit.org/show_bug.cgi?id=141335
     5
     6        caused missing symbols in non-WebKit clients of WTF::Vector
     7        (Requested by kling on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Remove WTF::fastMallocGoodSize()."
     12        https://bugs.webkit.org/show_bug.cgi?id=141020
     13        http://trac.webkit.org/changeset/179743
     14
    1152015-02-04  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/JavaScriptCore/assembler/AssemblerBuffer.h

    r179743 r179751  
    6969
    7070        AssemblerData(unsigned initialCapacity)
    71             : m_buffer(static_cast<char*>(fastMalloc(initialCapacity)))
    72             , m_capacity(initialCapacity)
    73         {
     71        {
     72            m_capacity = fastMallocGoodSize(initialCapacity);
     73            m_buffer = static_cast<char*>(fastMalloc(m_capacity));
    7474        }
    7575
     
    102102        void grow(unsigned extraCapacity = 0)
    103103        {
    104             m_capacity = m_capacity + m_capacity / 2 + extraCapacity;
     104            m_capacity = fastMallocGoodSize(m_capacity + m_capacity / 2 + extraCapacity);
    105105            m_buffer = static_cast<char*>(fastRealloc(m_buffer, m_capacity));
    106106        }
  • trunk/Source/WTF/ChangeLog

    r179743 r179751  
     12015-02-06  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r179743.
     4        https://bugs.webkit.org/show_bug.cgi?id=141335
     5
     6        caused missing symbols in non-WebKit clients of WTF::Vector
     7        (Requested by kling on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Remove WTF::fastMallocGoodSize()."
     12        https://bugs.webkit.org/show_bug.cgi?id=141020
     13        http://trac.webkit.org/changeset/179743
     14
    1152015-02-06  Andreas Kling  <akling@apple.com>
    216
  • trunk/Source/WTF/wtf/Compression.cpp

    r179743 r179751  
    7070
    7171    size_t currentOffset = OBJECT_OFFSETOF(GenericCompressedData, m_data);
    72     size_t currentCapacity = MinimumSize;
     72    size_t currentCapacity = fastMallocGoodSize(MinimumSize);
    7373    Bytef* compressedData = static_cast<Bytef*>(fastMalloc(currentCapacity));
    7474    memset(compressedData, 0, sizeof(GenericCompressedData));
     
    9595                newCapacity = std::max(static_cast<size_t>(expectedSize + 8), currentCapacity + 8);
    9696            }
     97            newCapacity = fastMallocGoodSize(newCapacity);
    9798            if (newCapacity >= dataLength)
    9899                goto fail;
  • trunk/Source/WTF/wtf/FastMalloc.cpp

    r179743 r179751  
    154154namespace WTF {
    155155
     156size_t fastMallocGoodSize(size_t bytes)
     157{
     158#if OS(DARWIN)
     159    return malloc_good_size(bytes);
     160#else
     161    return bytes;
     162#endif
     163}
     164
    156165#if OS(WINDOWS)
    157166
     
    287296    return 1;
    288297}
    289 
     298   
     299size_t fastMallocGoodSize(size_t size)
     300{
     301    return size;
     302}
     303   
    290304void* fastAlignedMalloc(size_t alignment, size_t size)
    291305{
     
    27532767
    27542768#define pageheap getPageHeap()
     2769
     2770size_t fastMallocGoodSize(size_t bytes)
     2771{
     2772    if (!phinited)
     2773        TCMalloc_ThreadCache::InitModule();
     2774    return AllocationSize(bytes);
     2775}
    27552776
    27562777#if USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY
  • trunk/Source/WTF/wtf/FastMalloc.h

    r179743 r179751  
    3636    WTF_EXPORT_PRIVATE char* fastStrDup(const char*);
    3737    WTF_EXPORT_PRIVATE size_t fastMallocSize(const void*);
     38    WTF_EXPORT_PRIVATE size_t fastMallocGoodSize(size_t);
    3839
    3940    // Allocations from fastAlignedMalloc() must be freed using fastAlignedFree().
     
    99100using WTF::fastFree;
    100101using WTF::fastMalloc;
     102using WTF::fastMallocGoodSize;
    101103using WTF::fastMallocSize;
    102104using WTF::fastRealloc;
  • trunk/Source/WTF/wtf/Vector.h

    r179743 r179751  
    265265        if (newCapacity > std::numeric_limits<unsigned>::max() / sizeof(T))
    266266            CRASH();
    267         m_capacity = newCapacity;
    268         m_buffer = static_cast<T*>(fastMalloc(newCapacity * sizeof(T)));
     267        size_t sizeToAllocate = fastMallocGoodSize(newCapacity * sizeof(T));
     268        m_capacity = sizeToAllocate / sizeof(T);
     269        m_buffer = static_cast<T*>(fastMalloc(sizeToAllocate));
    269270    }
    270271
     
    275276            return false;
    276277
     278        size_t sizeToAllocate = fastMallocGoodSize(newCapacity * sizeof(T));
    277279        T* newBuffer;
    278         if (tryFastMalloc(newCapacity * sizeof(T)).getValue(newBuffer)) {
    279             m_capacity = newCapacity;
     280        if (tryFastMalloc(sizeToAllocate).getValue(newBuffer)) {
     281            m_capacity = sizeToAllocate / sizeof(T);
    280282            m_buffer = newBuffer;
    281283            return true;
     
    294296        if (newCapacity > std::numeric_limits<size_t>::max() / sizeof(T))
    295297            CRASH();
    296         m_capacity = newCapacity;
    297         m_buffer = static_cast<T*>(fastRealloc(m_buffer, newCapacity * sizeof(T)));
     298        size_t sizeToAllocate = fastMallocGoodSize(newCapacity * sizeof(T));
     299        m_capacity = sizeToAllocate / sizeof(T);
     300        m_buffer = static_cast<T*>(fastRealloc(m_buffer, sizeToAllocate));
    298301    }
    299302
Note: See TracChangeset for help on using the changeset viewer.