diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-03-14 16:06:59 -0700 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-03-15 01:31:05 +0100 |
commit | 4432dc81879eddb39aee6aee19c525f53e2f4250 (patch) | |
tree | 45425656eecd9665e0ac68c1c036c62e2b75c13a /deps/v8 | |
parent | 14947b6c5e12ec65e6df75d4db5bcf47f7b29819 (diff) | |
download | node-4432dc81879eddb39aee6aee19c525f53e2f4250.tar.gz |
v8: 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.
Fixes #4010.
Diffstat (limited to 'deps/v8')
-rw-r--r-- | deps/v8/src/platform-posix.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/deps/v8/src/platform-posix.cc b/deps/v8/src/platform-posix.cc index 2b8001516..ad74eba8d 100644 --- a/deps/v8/src/platform-posix.cc +++ b/deps/v8/src/platform-posix.cc @@ -110,19 +110,25 @@ void* OS::GetRandomMmapAddr() { #else uint32_t raw_addr = V8::RandomPrivate(isolate); - // For our 32-bit mmap() hint, we pick a random address in the bottom + 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); systems will - // either try the hint and if that fails move higher (MacOS and other BSD - // derivatives) or try the hint and if that fails allocate as if there were - // no hint at all (Linux, Solaris, illumos and derivatives). 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 &= 0x3ffff000; + // 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 += 0x20000000; +# endif #endif return reinterpret_cast<void*>(raw_addr); } |