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

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/AddressSpaceRandomization.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "wtf/AddressSpaceRandomization.h" 5 #include "wtf/allocator/AddressSpaceRandomization.h"
6 6
7 #include "wtf/PageAllocator.h"
8 #include "wtf/SpinLock.h" 7 #include "wtf/SpinLock.h"
8 #include "wtf/allocator/PageAllocator.h"
9 9
10 #if OS(WIN) 10 #if OS(WIN)
11 #include <windows.h> 11 #include <windows.h>
12 #else 12 #else
13 #include <sys/time.h> 13 #include <sys/time.h>
14 #include <unistd.h> 14 #include <unistd.h>
15 #endif 15 #endif
16 16
17 namespace WTF { 17 namespace WTF {
18 18
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // This is a good range on Windows, Linux and Mac. 124 // This is a good range on Windows, Linux and Mac.
125 // Allocates in the 0.5-1.5GB region. 125 // Allocates in the 0.5-1.5GB region.
126 random &= 0x3fffffff; 126 random &= 0x3fffffff;
127 random += 0x20000000; 127 random += 0x20000000;
128 #endif // CPU(X86_64) 128 #endif // CPU(X86_64)
129 random &= kPageAllocationGranularityBaseMask; 129 random &= kPageAllocationGranularityBaseMask;
130 return reinterpret_cast<void*>(random); 130 return reinterpret_cast<void*>(random);
131 } 131 }
132 132
133 } // namespace WTF 133 } // namespace WTF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698