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 "wtf/AddressSanitizer.h" |
9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
10 #include "wtf/Atomics.h" | 10 #include "wtf/Atomics.h" |
11 #include "wtf/allocator/PageAllocator.h" | |
12 | 11 |
13 namespace blink { | 12 namespace blink { |
14 | 13 |
15 void MemoryRegion::release() { | 14 void MemoryRegion::release() { |
16 WTF::freePages(m_base, m_size); | 15 WTF::freePages(m_base, m_size); |
17 } | 16 } |
18 | 17 |
19 bool MemoryRegion::commit() { | 18 bool MemoryRegion::commit() { |
20 WTF::recommitSystemPages(m_base, m_size); | 19 WTF::recommitSystemPages(m_base, m_size); |
21 return WTF::setSystemPagesAccessible(m_base, m_size); | 20 return WTF::setSystemPagesAccessible(m_base, m_size); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 size_t allocationSize = payloadSize + 2 * blinkGuardPageSize; | 176 size_t allocationSize = payloadSize + 2 * blinkGuardPageSize; |
178 PageMemoryRegion* pageMemoryRegion = | 177 PageMemoryRegion* pageMemoryRegion = |
179 PageMemoryRegion::allocateLargePage(allocationSize, regionTree); | 178 PageMemoryRegion::allocateLargePage(allocationSize, regionTree); |
180 PageMemory* storage = | 179 PageMemory* storage = |
181 setupPageMemoryInRegion(pageMemoryRegion, 0, payloadSize); | 180 setupPageMemoryInRegion(pageMemoryRegion, 0, payloadSize); |
182 RELEASE_ASSERT(storage->commit()); | 181 RELEASE_ASSERT(storage->commit()); |
183 return storage; | 182 return storage; |
184 } | 183 } |
185 | 184 |
186 } // namespace blink | 185 } // namespace blink |
OLD | NEW |