Chromium Code Reviews| Index: third_party/tcmalloc/chromium/src/page_heap.cc |
| diff --git a/third_party/tcmalloc/chromium/src/page_heap.cc b/third_party/tcmalloc/chromium/src/page_heap.cc |
| index 402dc1f9e8a9a9421beb91cfbdcc28119a37f9b1..ab6f75257ab478d94577e0d02826cf2e73108df8 100644 |
| --- a/third_party/tcmalloc/chromium/src/page_heap.cc |
| +++ b/third_party/tcmalloc/chromium/src/page_heap.cc |
| @@ -467,6 +467,10 @@ bool PageHeap::GrowHeap(Length n) { |
| ASSERT(kMaxPages >= kMinSystemAlloc); |
| if (n > kMaxValidPages) return false; |
| Length ask = (n>kMinSystemAlloc) ? n : static_cast<Length>(kMinSystemAlloc); |
| + // Check if it's ok to grow the heap for this much. This is a security |
| + // measure to make sure that large allocations fail. |
| + if (!IsContiguousAllocSizePermitted(n << kPageShift)) |
|
jar (doing other things)
2013/01/12 16:13:29
nit: test should come next to similar test in line
|
| + return false; |
| size_t actual_size; |
| void* ptr = TCMalloc_SystemAlloc(ask << kPageShift, &actual_size, kPageSize); |
| if (ptr == NULL) { |