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

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

Issue 2713903002: Move spin_lock into partition_allocator. (Closed)
Patch Set: Remove unnecessary DEPS line. Created 3 years, 10 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 | « base/BUILD.gn ('k') | base/allocator/partition_allocator/partition_alloc.h » ('j') | 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/synchronization/spin_lock.h" 8 #include "base/allocator/partition_allocator/spin_lock.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
11 #if defined(OS_WIN) 11 #if defined(OS_WIN)
12 #include <windows.h> 12 #include <windows.h>
13 #else 13 #else
14 #include <sys/time.h> 14 #include <sys/time.h>
15 #include <unistd.h> 15 #include <unistd.h>
16 #endif 16 #endif
17 17
18 namespace base { 18 namespace base {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // This is a good range on Windows, Linux and Mac. 121 // This is a good range on Windows, Linux and Mac.
122 // Allocates in the 0.5-1.5GB region. 122 // Allocates in the 0.5-1.5GB region.
123 random &= 0x3fffffff; 123 random &= 0x3fffffff;
124 random += 0x20000000; 124 random += 0x20000000;
125 #endif // defined(ARCH_CPU_X86_64) 125 #endif // defined(ARCH_CPU_X86_64)
126 random &= kPageAllocationGranularityBaseMask; 126 random &= kPageAllocationGranularityBaseMask;
127 return reinterpret_cast<void*>(random); 127 return reinterpret_cast<void*>(random);
128 } 128 }
129 129
130 } // namespace base 130 } // namespace base
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/allocator/partition_allocator/partition_alloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698