Changeset 155474 in webkit
- Timestamp:
- Sep 10, 2013, 2:18:53 PM (13 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
wtf/HashTable.h (modified) (2 diffs)
-
wtf/SizeLimits.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r155470 r155474 1 2013-09-10 Anders Carlsson <andersca@apple.com> 2 3 Remove more uses of WTF::AlignedBuffer 4 https://bugs.webkit.org/show_bug.cgi?id=121119 5 6 Reviewed by Andreas Kling. 7 8 * wtf/HashTable.h: 9 * wtf/SizeLimits.cpp: 10 1 11 2013-09-10 Anders Carlsson <andersca@apple.com> 2 12 -
trunk/Source/WTF/wtf/HashTable.h
r155407 r155474 24 24 25 25 #include <string.h> 26 #include <wtf/Alignment.h> 26 #include <type_traits> 27 #include <utility> 27 28 #include <wtf/Assertions.h> 28 29 #include <wtf/FastMalloc.h> … … 591 592 return; 592 593 ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key)); 593 AlignedBuffer<sizeof(ValueType), WTF_ALIGN_OF(ValueType)>deletedValueBuffer;594 ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>( deletedValueBuffer.buffer);594 typename std::aligned_storage<sizeof(ValueType), std::alignment_of<ValueType>::value>::type deletedValueBuffer; 595 ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(&deletedValueBuffer); 595 596 ValueType& deletedValue = *deletedValuePtr; 596 597 Traits::constructDeletedValue(deletedValue); -
trunk/Source/WTF/wtf/SizeLimits.cpp
r153638 r155474 31 31 #include "config.h" 32 32 33 #include <type_traits> 34 #include <utility> 33 35 #include <wtf/Assertions.h> 34 36 #include <wtf/OwnPtr.h> … … 68 70 struct SameSizeAsVectorWithInlineCapacity { 69 71 SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity; 70 AlignedBuffer<inlineCapacity * sizeof(T), WTF_ALIGN_OF(T)> inlineBuffer;72 typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type inlineBuffer[inlineCapacity]; 71 73 }; 72 74 73 COMPILE_ASSERT(sizeof(OwnPtr<int>) == sizeof(int*), OwnPtr_should_stay_small);74 COMPILE_ASSERT(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), PassRefPtr_should_stay_small);75 COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), RefCounted_should_stay_small);76 COMPILE_ASSERT(sizeof(RefCountedCustomAllocated<int>) == sizeof(SameSizeAsRefCounted), RefCountedCustomAllocated_should_stay_small);77 COMPILE_ASSERT(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), RefPtr_should_stay_small);78 COMPILE_ASSERT(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<int>), Vector_should_stay_small);79 COMPILE_ASSERT(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), Vector_should_stay_small);80 COMPILE_ASSERT(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), Vector_should_stay_small);81 COMPILE_ASSERT(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), Vector_should_stay_small);75 static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small!"); 76 static_assert(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), "PassRefPtr should stay small!"); 77 static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!"); 78 static_assert(sizeof(RefCountedCustomAllocated<int>) == sizeof(SameSizeAsRefCounted), "RefCountedCustomAllocated should stay small!"); 79 static_assert(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), "RefPtr should stay small!"); 80 static_assert(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<int>), "Vector should stay small!"); 81 static_assert(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), "Vector should stay small!"); 82 static_assert(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), "Vector should stay small!"); 83 static_assert(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), "Vector should stay small!"); 82 84 }
Note:
See TracChangeset
for help on using the changeset viewer.