Modified: trunk/Source/WTF/ChangeLog (155473 => 155474)
--- trunk/Source/WTF/ChangeLog 2013-09-10 21:16:42 UTC (rev 155473)
+++ trunk/Source/WTF/ChangeLog 2013-09-10 21:18:53 UTC (rev 155474)
@@ -1,5 +1,15 @@
2013-09-10 Anders Carlsson <[email protected]>
+ Remove more uses of WTF::AlignedBuffer
+ https://bugs.webkit.org/show_bug.cgi?id=121119
+
+ Reviewed by Andreas Kling.
+
+ * wtf/HashTable.h:
+ * wtf/SizeLimits.cpp:
+
+2013-09-10 Anders Carlsson <[email protected]>
+
Clean up wtf/Noncopyable.h
https://bugs.webkit.org/show_bug.cgi?id=121115
Modified: trunk/Source/WTF/wtf/HashTable.h (155473 => 155474)
--- trunk/Source/WTF/wtf/HashTable.h 2013-09-10 21:16:42 UTC (rev 155473)
+++ trunk/Source/WTF/wtf/HashTable.h 2013-09-10 21:18:53 UTC (rev 155474)
@@ -23,7 +23,8 @@
#define WTF_HashTable_h
#include <string.h>
-#include <wtf/Alignment.h>
+#include <type_traits>
+#include <utility>
#include <wtf/Assertions.h>
#include <wtf/FastMalloc.h>
#include <wtf/HashTraits.h>
@@ -590,8 +591,8 @@
if (!HashFunctions::safeToCompareToEmptyOrDeleted)
return;
ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));
- AlignedBuffer<sizeof(ValueType), WTF_ALIGN_OF(ValueType)> deletedValueBuffer;
- ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(deletedValueBuffer.buffer);
+ typename std::aligned_storage<sizeof(ValueType), std::alignment_of<ValueType>::value>::type deletedValueBuffer;
+ ValueType* deletedValuePtr = reinterpret_cast_ptr<ValueType*>(&deletedValueBuffer);
ValueType& deletedValue = *deletedValuePtr;
Traits::constructDeletedValue(deletedValue);
ASSERT(!HashTranslator::equal(Extractor::extract(deletedValue), key));
Modified: trunk/Source/WTF/wtf/SizeLimits.cpp (155473 => 155474)
--- trunk/Source/WTF/wtf/SizeLimits.cpp 2013-09-10 21:16:42 UTC (rev 155473)
+++ trunk/Source/WTF/wtf/SizeLimits.cpp 2013-09-10 21:18:53 UTC (rev 155474)
@@ -30,6 +30,8 @@
#include "config.h"
+#include <type_traits>
+#include <utility>
#include <wtf/Assertions.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -67,16 +69,16 @@
template<typename T, unsigned inlineCapacity>
struct SameSizeAsVectorWithInlineCapacity {
SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity;
- AlignedBuffer<inlineCapacity * sizeof(T), WTF_ALIGN_OF(T)> inlineBuffer;
+ typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type inlineBuffer[inlineCapacity];
};
-COMPILE_ASSERT(sizeof(OwnPtr<int>) == sizeof(int*), OwnPtr_should_stay_small);
-COMPILE_ASSERT(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), PassRefPtr_should_stay_small);
-COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), RefCounted_should_stay_small);
-COMPILE_ASSERT(sizeof(RefCountedCustomAllocated<int>) == sizeof(SameSizeAsRefCounted), RefCountedCustomAllocated_should_stay_small);
-COMPILE_ASSERT(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), RefPtr_should_stay_small);
-COMPILE_ASSERT(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<int>), Vector_should_stay_small);
-COMPILE_ASSERT(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), Vector_should_stay_small);
-COMPILE_ASSERT(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), Vector_should_stay_small);
-COMPILE_ASSERT(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), Vector_should_stay_small);
+static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small!");
+static_assert(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), "PassRefPtr should stay small!");
+static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCounted should stay small!");
+static_assert(sizeof(RefCountedCustomAllocated<int>) == sizeof(SameSizeAsRefCounted), "RefCountedCustomAllocated should stay small!");
+static_assert(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), "RefPtr should stay small!");
+static_assert(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<int>), "Vector should stay small!");
+static_assert(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 1>), "Vector should stay small!");
+static_assert(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 2>), "Vector should stay small!");
+static_assert(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapacity<int, 3>), "Vector should stay small!");
}