Revision: 15870
Author: [email protected]
Date: Thu Jul 25 01:06:13 2013
Log: move 32 bit heap hint on sunos
Setting the V8 heap at or near 0x20000000 on 32bit sunos only allows
512 MB of heap space, instead on sunos move this to 0x80000000.
To quote the comment
For our Solaris/illumos mmap hint, we pick a random address in the bottom
half of the top half of the address space (that is, the third quarter).
Because we do not MAP_FIXED, this will be treated only as a hint -- the
system will not fail to mmap() because something else happens to already
be mapped at our random address. We deliberately set the hint high enough
to get well above the system's break (that is, the heap); Solaris and
illumos will try the hint and if that fails allocate as if there were
no hint at all. The high hint prevents the break from getting hemmed in
at low values, ceding half of the address space to the system heap.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/19859008
Patch from Timothy J. Fontaine <[email protected]>.
http://code.google.com/p/v8/source/detail?r=15870
Modified:
/branches/bleeding_edge/src/platform-posix.cc
=======================================
--- /branches/bleeding_edge/src/platform-posix.cc Thu Jul 25 01:00:32 2013
+++ /branches/bleeding_edge/src/platform-posix.cc Thu Jul 25 01:06:13 2013
@@ -151,11 +151,26 @@
raw_addr &= V8_UINT64_C(0x3ffffffff000);
#else
uint32_t raw_addr = V8::RandomPrivate(isolate);
+
+ raw_addr &= 0x3ffff000;
+
+# ifdef __sun
+ // For our Solaris/illumos mmap hint, we pick a random address in the
bottom
+ // half of the top half of the address space (that is, the third
quarter).
+ // Because we do not MAP_FIXED, this will be treated only as a hint --
the
+ // system will not fail to mmap() because something else happens to
already
+ // be mapped at our random address. We deliberately set the hint high
enough
+ // to get well above the system's break (that is, the heap); Solaris
and
+ // illumos will try the hint and if that fails allocate as if there
were
+ // no hint at all. The high hint prevents the break from getting
hemmed in
+ // at low values, ceding half of the address space to the system heap.
+ raw_addr += 0x80000000;
+# else
// The range 0x20000000 - 0x60000000 is relatively unpopulated across a
// variety of ASLR modes (PAE kernel, NX compat mode, etc) and on macos
// 10.6 and 10.7.
- raw_addr &= 0x3ffff000;
raw_addr += 0x20000000;
+# endif
#endif
return reinterpret_cast<void*>(raw_addr);
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.