summaryrefslogtreecommitdiff
path: root/deps/v8/src/platform-posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/platform-posix.cc')
-rw-r--r--deps/v8/src/platform-posix.cc20
1 files changed, 3 insertions, 17 deletions
diff --git a/deps/v8/src/platform-posix.cc b/deps/v8/src/platform-posix.cc
index 2cf898dd60..f76ec44332 100644
--- a/deps/v8/src/platform-posix.cc
+++ b/deps/v8/src/platform-posix.cc
@@ -115,26 +115,11 @@ void* OS::GetRandomMmapAddr() {
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);
}
@@ -219,7 +204,7 @@ int64_t OS::Ticks() {
double OS::DaylightSavingsOffset(double time) {
- if (isnan(time)) return nan_value();
+ if (std::isnan(time)) return nan_value();
time_t tv = static_cast<time_t>(floor(time/msPerSecond));
struct tm* t = localtime(&tv);
if (NULL == t) return nan_value();
@@ -349,6 +334,7 @@ OS::MemMoveFunction CreateMemMoveFunction();
// Copy memory area. No restrictions.
void OS::MemMove(void* dest, const void* src, size_t size) {
+ if (size == 0) return;
// Note: here we rely on dependent reads being ordered. This is true
// on all architectures we currently support.
(*memmove_function)(dest, src, size);