Changeset 133160 in webkit
- Timestamp:
- Nov 1, 2012 7:10:37 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r133158 r133160 1 2012-11-01 Andreas Kling <kling@webkit.org> 2 3 Fix StylePropertySet/ElementAttributeData custom allocation in debug builds. 4 <http://webkit.org/b/100753> 5 6 Unreviewed debug bot crash fix after r133138. 7 8 There's additional padding after StylePropertySet and ElementAttributeData 9 in 64-bit debug builds since there are additional members in RefCountedBase. 10 Use 'sizeof(ImmutableFoo) - sizeof(void*)' as the base size of ImmutableFoo. 11 12 * css/StylePropertySet.cpp: 13 (WebCore::sizeForImmutableStylePropertySetWithPropertyCount): 14 * dom/ElementAttributeData.cpp: 15 (WebCore::sizeForImmutableElementAttributeDataWithAttributeCount): 16 (WebCore::ElementAttributeData::createImmutable): 17 (WebCore::ElementAttributeData::reportMemoryUsage): 18 1 19 2012-11-01 Stephen Chenney <schenney@chromium.org> 2 20 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r133148 r133160 58 58 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) 59 59 { 60 return sizeof( StylePropertySet) + sizeof(CSSValue*) * count + sizeof(StylePropertyMetadata) * count;60 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*) * count + sizeof(StylePropertyMetadata) * count; 61 61 } 62 62 -
trunk/Source/WebCore/dom/ElementAttributeData.cpp
r132288 r133160 36 36 namespace WebCore { 37 37 38 static size_t immutableElementAttributeDataSize(unsigned count)39 { 40 return sizeof( ElementAttributeData) + sizeof(Attribute) * count;38 static size_t sizeForImmutableElementAttributeDataWithAttributeCount(unsigned count) 39 { 40 return sizeof(ImmutableElementAttributeData) - sizeof(void*) + sizeof(Attribute) * count; 41 41 } 42 42 43 43 PassRefPtr<ElementAttributeData> ElementAttributeData::createImmutable(const Vector<Attribute>& attributes) 44 44 { 45 void* slot = WTF::fastMalloc( immutableElementAttributeDataSize(attributes.size()));45 void* slot = WTF::fastMalloc(sizeForImmutableElementAttributeDataWithAttributeCount(attributes.size())); 46 46 return adoptRef(new (slot) ImmutableElementAttributeData(attributes)); 47 47 } … … 275 275 void ElementAttributeData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 276 276 { 277 size_t actualSize = m_isMutable ? sizeof(ElementAttributeData) : immutableElementAttributeDataSize(m_arraySize);277 size_t actualSize = m_isMutable ? sizeof(ElementAttributeData) : sizeForImmutableElementAttributeDataWithAttributeCount(m_arraySize); 278 278 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM, actualSize); 279 279 info.addMember(m_inlineStyleDecl);
Note: See TracChangeset
for help on using the changeset viewer.