| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/heap/PageMemory.h" | 5 #include "platform/heap/PageMemory.h" |
| 6 | 6 |
| 7 #include "platform/heap/Heap.h" | 7 #include "platform/heap/Heap.h" |
| 8 #include "platform/wtf/AddressSanitizer.h" | 8 #include "platform/wtf/AddressSanitizer.h" |
| 9 #include "platform/wtf/Assertions.h" | 9 #include "platform/wtf/Assertions.h" |
| 10 #include "platform/wtf/Atomics.h" | 10 #include "platform/wtf/Atomics.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Round up the requested size to nearest os page size. | 164 // Round up the requested size to nearest os page size. |
| 165 payload_size = RoundToOsPageSize(payload_size); | 165 payload_size = RoundToOsPageSize(payload_size); |
| 166 | 166 |
| 167 // Overallocate by 2 times OS page size to have space for a | 167 // Overallocate by 2 times OS page size to have space for a |
| 168 // guard page at the beginning and end of blink heap page. | 168 // guard page at the beginning and end of blink heap page. |
| 169 size_t allocation_size = payload_size + 2 * kBlinkGuardPageSize; | 169 size_t allocation_size = payload_size + 2 * kBlinkGuardPageSize; |
| 170 PageMemoryRegion* page_memory_region = | 170 PageMemoryRegion* page_memory_region = |
| 171 PageMemoryRegion::AllocateLargePage(allocation_size, region_tree); | 171 PageMemoryRegion::AllocateLargePage(allocation_size, region_tree); |
| 172 PageMemory* storage = | 172 PageMemory* storage = |
| 173 SetupPageMemoryInRegion(page_memory_region, 0, payload_size); | 173 SetupPageMemoryInRegion(page_memory_region, 0, payload_size); |
| 174 RELEASE_ASSERT(storage->Commit()); | 174 CHECK(storage->Commit()); |
| 175 return storage; | 175 return storage; |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |