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

Side by Side Diff: base/allocator/partition_allocator/address_space_randomization.cc

Issue 2855933002: Only include base/win/windows_version.h on Windows build (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/allocator/partition_allocator/address_space_randomization.h" 5 #include "base/allocator/partition_allocator/address_space_randomization.h"
6 6
7 #include "base/allocator/partition_allocator/page_allocator.h" 7 #include "base/allocator/partition_allocator/page_allocator.h"
8 #include "base/allocator/partition_allocator/spin_lock.h" 8 #include "base/allocator/partition_allocator/spin_lock.h"
9 #include "base/win/windows_version.h"
10 #include "build/build_config.h" 9 #include "build/build_config.h"
11 10
12 #if defined(OS_WIN) 11 #if defined(OS_WIN)
13 #include <windows.h> 12 #include <windows.h>
13 #include "base/win/windows_version.h"
14 #else 14 #else
15 #include <sys/time.h> 15 #include <sys/time.h>
16 #include <unistd.h> 16 #include <unistd.h>
17 #endif 17 #endif
18 18
19 // VersionHelpers.h must be included after windows.h. 19 // VersionHelpers.h must be included after windows.h.
20 #if defined(OS_WIN) 20 #if defined(OS_WIN)
21 #include <VersionHelpers.h> 21 #include <VersionHelpers.h>
22 #endif 22 #endif
23 23
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // This is a good range on Windows, Linux and Mac. 133 // This is a good range on Windows, Linux and Mac.
134 // Allocates in the 0.5-1.5GB region. 134 // Allocates in the 0.5-1.5GB region.
135 random &= 0x3fffffff; 135 random &= 0x3fffffff;
136 random += 0x20000000; 136 random += 0x20000000;
137 #endif // defined(ARCH_CPU_X86_64) 137 #endif // defined(ARCH_CPU_X86_64)
138 random &= kPageAllocationGranularityBaseMask; 138 random &= kPageAllocationGranularityBaseMask;
139 return reinterpret_cast<void*>(random); 139 return reinterpret_cast<void*>(random);
140 } 140 }
141 141
142 } // namespace base 142 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698