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..910cfd131a9f24b31f80a2a3e350ffa851b08c82 100644 |
| --- a/third_party/tcmalloc/chromium/src/page_heap.cc |
| +++ b/third_party/tcmalloc/chromium/src/page_heap.cc |
| @@ -467,6 +467,11 @@ bool PageHeap::GrowHeap(Length n) { |
| ASSERT(kMaxPages >= kMinSystemAlloc); |
| if (n > kMaxValidPages) return false; |
| Length ask = (n>kMinSystemAlloc) ? n : static_cast<Length>(kMinSystemAlloc); |
| + // For most allocators it's ok to check for size here as they won't generally |
| + // grow existing mappings. Some implementations, such as the Linux brk heap |
| + // implementation will however require additional checks. |
| + if (!IsContiguousAllocSizePermitted(n << kPageShift)) |
|
jln (very slow on Chromium)
2013/01/11 06:02:29
It's a bit ugly to have the check here *and* in th
|
| + return false; |
| size_t actual_size; |
| void* ptr = TCMalloc_SystemAlloc(ask << kPageShift, &actual_size, kPageSize); |
| if (ptr == NULL) { |