Chromium Code Reviews| Index: Source/wtf/PageAllocator.cpp |
| diff --git a/Source/wtf/PageAllocator.cpp b/Source/wtf/PageAllocator.cpp |
| index fda703aec591d619f15f31d7d7f3fb0740bac9a6..a6b27d424fa6a183493555ef9f36a4dd31ff8480 100644 |
| --- a/Source/wtf/PageAllocator.cpp |
| +++ b/Source/wtf/PageAllocator.cpp |
| @@ -62,18 +62,21 @@ namespace WTF { |
| static bool shouldUseAddressHint() |
| { |
| -#if CPU(32BIT) |
| +#if !CPU(64BIT) |
|
Chris Evans
2014/11/14 01:48:16
I kind of like having the symmetry of both CPU(32B
|
| // When running 32-bit processes under 32-bit Windows, the userspace is |
| // limited to 2 GB, and we risk fragmenting it badly if we allow further |
| // randomization via our address hint. On the other hand, if the process |
| // is running under WOW64, then it has at least 3 GB available (and likely |
| // 4 GB depending upon the OS version), and we want use the additional |
| // randomness. |
| - // TODO(tsepez): presently disabled due to IsWow64Process() compatibility. |
| - return true; |
| -#else // CPU(32BIT) |
| + static BOOL bIsWow64 = -1; |
| + if (bIsWow64 == -1) { |
| + IsWow64Process(GetCurrentProcess(), &bIsWow64); |
| + } |
| + return !!bIsWow64; |
| +#else // !CPU(64BIT) |
| return true; |
| -#endif // CPU(32BIT) |
| +#endif // !CPU(64BIT) |
| } |
| #endif // OS(WIN) |