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/Assertions.h" | 8 #include "wtf/Assertions.h" |
9 #include "wtf/Atomics.h" | 9 #include "wtf/Atomics.h" |
10 #include "wtf/PageAllocator.h" | 10 #include "wtf/allocator/PageAllocator.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 void MemoryRegion::release() | 14 void MemoryRegion::release() |
15 { | 15 { |
16 WTF::freePages(m_base, m_size); | 16 WTF::freePages(m_base, m_size); |
17 } | 17 } |
18 | 18 |
19 bool MemoryRegion::commit() | 19 bool MemoryRegion::commit() |
20 { | 20 { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Overallocate by 2 times OS page size to have space for a | 180 // Overallocate by 2 times OS page size to have space for a |
181 // guard page at the beginning and end of blink heap page. | 181 // guard page at the beginning and end of blink heap page. |
182 size_t allocationSize = payloadSize + 2 * blinkGuardPageSize; | 182 size_t allocationSize = payloadSize + 2 * blinkGuardPageSize; |
183 PageMemoryRegion* pageMemoryRegion = PageMemoryRegion::allocateLargePage(all
ocationSize, regionTree); | 183 PageMemoryRegion* pageMemoryRegion = PageMemoryRegion::allocateLargePage(all
ocationSize, regionTree); |
184 PageMemory* storage = setupPageMemoryInRegion(pageMemoryRegion, 0, payloadSi
ze); | 184 PageMemory* storage = setupPageMemoryInRegion(pageMemoryRegion, 0, payloadSi
ze); |
185 RELEASE_ASSERT(storage->commit()); | 185 RELEASE_ASSERT(storage->commit()); |
186 return storage; | 186 return storage; |
187 } | 187 } |
188 | 188 |
189 } // namespace blink | 189 } // namespace blink |
OLD | NEW |