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

Unified Diff: Source/wtf/PageAllocator.cpp

Issue 717263005: Re-land: 178586 Avoid fragmenting address space on small windows systems. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/CPU.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/wtf/CPU.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698