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

Unified Diff: Source/platform/heap/Heap.h

Issue 343753004: Oilpan: Improve address space randomization for the Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix typo Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 816062a3e8ab95a0806271b7771df95fd642c86d..6c1e4d23b808eb31aefa18103b478540db3e7a49 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -52,6 +52,13 @@ const size_t blinkPageSizeLog2 = 17;
const size_t blinkPageSize = 1 << blinkPageSizeLog2;
const size_t blinkPageOffsetMask = blinkPageSize - 1;
const size_t blinkPageBaseMask = ~blinkPageOffsetMask;
+
+// We allocate pages at random addresses but in groups of
+// blinkPagesPerRegion at a given random address. We group pages to
+// not spread out too much over the address space which would blow
+// away the page tables and lead to bad performance.
+const size_t blinkPagesPerRegion = 10;
+
// Double precision floats are more efficient when 8 byte aligned, so we 8 byte
// align all allocations even on 32 bit.
const size_t allocationGranularity = 8;
@@ -823,6 +830,7 @@ public:
inline Address allocate(size_t, const GCInfo*);
void addToFreeList(Address, size_t);
+ void addPageMemoryToPool(PageMemory*);
void addPageToPool(HeapPage<Header>*);
inline static size_t roundedAllocationSize(size_t size)
{
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698