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

Unified Diff: Source/wtf/PageAllocator.cpp

Issue 1183923005: Remove unused shouldUseAddressHint. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 69ec177174d9615f29db918443c762a8587da048..b9f3eae6a5c5bee8c75891eed51485995a55fc77 100644
--- a/Source/wtf/PageAllocator.cpp
+++ b/Source/wtf/PageAllocator.cpp
@@ -58,26 +58,6 @@
namespace WTF {
-#if OS(WIN)
-
-static bool shouldUseAddressHint()
-{
-#if CPU(32BIT)
- // 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)
- return true;
-#endif // CPU(32BIT)
-}
-
-#endif // OS(WIN)
-
// This simple internal function wraps the OS-specific page allocation call so
// that it behaves consistently: the address is a hint and if it cannot be used,
// the allocation will be placed elsewhere.
@@ -85,11 +65,10 @@ static void* systemAllocPages(void* addr, size_t len, PageAccessibilityConfigura
{
ASSERT(!(len & kPageAllocationGranularityOffsetMask));
ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kPageAllocationGranularityOffsetMask));
- void* ret = 0;
+ void* ret;
#if OS(WIN)
int accessFlag = pageAccessibility == PageAccessible ? PAGE_READWRITE : PAGE_NOACCESS;
- if (shouldUseAddressHint())
- ret = VirtualAlloc(addr, len, MEM_RESERVE | MEM_COMMIT, accessFlag);
+ ret = VirtualAlloc(addr, len, MEM_RESERVE | MEM_COMMIT, accessFlag);
if (!ret)
ret = VirtualAlloc(0, len, MEM_RESERVE | MEM_COMMIT, accessFlag);
#else
« 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