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..4699fe902cad8587045305f7e0e3643245d1acfc 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(count <= maxElementCountInBackingStore<T>()); |
Yuta Kitamura
2017/01/30 07:19:42
nit+optional: Use CHECK_LE?
sof
2017/01/31 21:01:43
Done.
|
return PartitionAllocActualSize(WTF::Partitions::bufferPartition(), |
count * sizeof(T)); |
} |