Revision: 5655
Author: [email protected]
Date: Tue Oct 19 01:23:47 2010
Log: Make randomized allocations along 64k granularity boundaries to avoid comitting unused memory.

BUG=56036
TEST=None.

Patch by Justin Schuh <[email protected]>

Review URL: http://codereview.chromium.org/3849004


http://code.google.com/p/v8/source/detail?r=5655

Modified:
 /branches/bleeding_edge/src/platform-win32.cc

=======================================
--- /branches/bleeding_edge/src/platform-win32.cc       Mon Oct 18 05:37:07 2010
+++ /branches/bleeding_edge/src/platform-win32.cc       Tue Oct 19 01:23:47 2010
@@ -845,14 +845,15 @@
                    bool is_executable) {
   // The address range used to randomize RWX allocations in OS::Allocate
   // Try not to map pages into the default range that windows loads DLLs
+  // Use a multiple of 64k to prevent committing unused memory.
   // Note: This does not guarantee RWX regions will be within the
   // range kAllocationRandomAddressMin to kAllocationRandomAddressMax
 #ifdef V8_HOST_ARCH_64_BIT
   static const intptr_t kAllocationRandomAddressMin = 0x0000000080000000;
-  static const intptr_t kAllocationRandomAddressMax = 0x000004FFFFFFFFFF;
+  static const intptr_t kAllocationRandomAddressMax = 0x000003FFFFFF0000;
 #else
   static const intptr_t kAllocationRandomAddressMin = 0x04000000;
-  static const intptr_t kAllocationRandomAddressMax = 0x4FFFFFFF;
+  static const intptr_t kAllocationRandomAddressMax = 0x3FFF0000;
 #endif

   // VirtualAlloc rounds allocated size to page size automatically.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to