OLD | NEW |
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 Loading... |
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 |
OLD | NEW |