| 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 "wtf/AddressSanitizer.h" | 8 #include "platform/wtf/AddressSanitizer.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "platform/wtf/Assertions.h" |
| 10 #include "wtf/Atomics.h" | 10 #include "platform/wtf/Atomics.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 void MemoryRegion::release() { | 14 void MemoryRegion::release() { |
| 15 WTF::FreePages(m_base, m_size); | 15 WTF::FreePages(m_base, m_size); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool MemoryRegion::commit() { | 18 bool MemoryRegion::commit() { |
| 19 WTF::RecommitSystemPages(m_base, m_size); | 19 WTF::RecommitSystemPages(m_base, m_size); |
| 20 return WTF::SetSystemPagesAccessible(m_base, m_size); | 20 return WTF::SetSystemPagesAccessible(m_base, m_size); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 size_t allocationSize = payloadSize + 2 * blinkGuardPageSize; | 169 size_t allocationSize = payloadSize + 2 * blinkGuardPageSize; |
| 170 PageMemoryRegion* pageMemoryRegion = | 170 PageMemoryRegion* pageMemoryRegion = |
| 171 PageMemoryRegion::allocateLargePage(allocationSize, regionTree); | 171 PageMemoryRegion::allocateLargePage(allocationSize, regionTree); |
| 172 PageMemory* storage = | 172 PageMemory* storage = |
| 173 setupPageMemoryInRegion(pageMemoryRegion, 0, payloadSize); | 173 setupPageMemoryInRegion(pageMemoryRegion, 0, payloadSize); |
| 174 RELEASE_ASSERT(storage->commit()); | 174 RELEASE_ASSERT(storage->commit()); |
| 175 return storage; | 175 return storage; |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |