| Index: base/allocator/partition_allocator/address_space_randomization.cc
|
| diff --git a/base/allocator/partition_allocator/address_space_randomization.cc b/base/allocator/partition_allocator/address_space_randomization.cc
|
| index ca9efdd8be49e527e901358d2db0b1ed43cd0ae3..d54fb4434e3104c8c7b90aedfcc767887cfef5be 100644
|
| --- a/base/allocator/partition_allocator/address_space_randomization.cc
|
| +++ b/base/allocator/partition_allocator/address_space_randomization.cc
|
| @@ -16,6 +16,11 @@
|
| #include <unistd.h>
|
| #endif
|
|
|
| +// VersionHelpers.h must be included after windows.h.
|
| +#if defined(OS_WIN)
|
| +#include <VersionHelpers.h>
|
| +#endif
|
| +
|
| namespace base {
|
|
|
| namespace {
|
| @@ -92,7 +97,13 @@ void* GetRandomPageBase() {
|
| #if defined(OS_WIN)
|
| random &= 0x3ffffffffffUL;
|
| // Windows >= 8.1 has the full 47 bits. Use them where available.
|
| - if (base::win::GetVersion() < base::win::Version::VERSION_WIN8_1) {
|
| + static bool windows_81 = false;
|
| + static bool windows_81_initialized = false;
|
| + if (!windows_81_initialized) {
|
| + windows_81 = IsWindows8Point1OrGreater();
|
| + windows_81_initialized = true;
|
| + }
|
| + if (!windows_81) {
|
| random += 0x10000000000UL;
|
| }
|
| #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
|
|
|