Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/platform/heap/PageMemory.cpp

Issue 1881983003: Move PartitionAlloc related things into wtf/allocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698