Index: third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h |
diff --git a/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h b/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h |
index 1408aa16499e695bf02771ec0cb159fca97d9e4f..7e2bc45185e657b4e7c10eb0027953b36a07b3a9 100644 |
--- a/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h |
+++ b/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h |
@@ -27,9 +27,14 @@ class WTF_EXPORT PartitionAllocator { |
typedef PartitionAllocatorDummyVisitor Visitor; |
static const bool isGarbageCollected = false; |
+ template<typename T> |
+ static size_t maxElementCountInBackingStore() { |
+ return base::kGenericMaxDirectMapped / sizeof(T); |
+ } |
+ |
template <typename T> |
static size_t quantizedSize(size_t count) { |
- RELEASE_ASSERT(count <= base::kGenericMaxDirectMapped / sizeof(T)); |
+ CHECK_LE(count, maxElementCountInBackingStore<T>()); |
return PartitionAllocActualSize(WTF::Partitions::bufferPartition(), |
count * sizeof(T)); |
} |