Index: third_party/WebKit/Source/wtf/TerminatedArray.h |
diff --git a/third_party/WebKit/Source/wtf/TerminatedArray.h b/third_party/WebKit/Source/wtf/TerminatedArray.h |
index 873bc5b881a6c9e9f1dfcb90b45ff2b2236b4139..18193a4764a80ed26444d047e430fb8d8476dd74 100644 |
--- a/third_party/WebKit/Source/wtf/TerminatedArray.h |
+++ b/third_party/WebKit/Source/wtf/TerminatedArray.h |
@@ -6,6 +6,7 @@ |
#include "wtf/Allocator.h" |
#include "wtf/PtrUtil.h" |
+#include "wtf/VectorTraits.h" |
#include "wtf/allocator/Partitions.h" |
#include <memory> |
@@ -21,6 +22,11 @@ class TerminatedArray { |
WTF_MAKE_NONCOPYABLE(TerminatedArray); |
public: |
+ // When TerminatedArray::Allocator implementations grow the backing |
+ // store, old is copied into the new and larger block. |
+ static_assert(VectorTraits<T>::canCopyWithMemcpy, |
+ "Array elements must be memory copyable"); |
+ |
T& at(size_t index) { return reinterpret_cast<T*>(this)[index]; } |
const T& at(size_t index) const { |
return reinterpret_cast<const T*>(this)[index]; |