Chromium Code Reviews| Index: src/platform-posix.cc |
| diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
| index 923cd8700ed9a062c8ed8ad7a505da253ae084dd..b19c54201c7a1e8adee4f3e26b15a726539e9a23 100644 |
| --- a/src/platform-posix.cc |
| +++ b/src/platform-posix.cc |
| @@ -130,6 +130,13 @@ uint64_t OS::TotalPhysicalMemory() { |
| return 0; |
| } |
| return static_cast<uint64_t>(memory_info.dwTotalPhys); |
| +#elif V8_OS_QNX |
| + struct stat stat_buf; |
| + if (stat("/proc", &stat_buf) != 0) { |
| + UNREACHABLE(); |
| + return 0; |
| + } |
| + return static_cast<uint64_t>(stat_buf.st_size); |
| #else |
| intptr_t pages = sysconf(_SC_PHYS_PAGES); |
| intptr_t page_size = sysconf(_SC_PAGESIZE); |
| @@ -247,7 +254,11 @@ void* OS::GetRandomMmapAddr() { |
| size_t OS::AllocateAlignment() { |
| +#if defined(V8_OS_QNX) |
|
Benedikt Meurer
2013/11/15 11:49:59
Use #if V8_OS_QNX.
c.truta
2013/11/18 13:36:32
D'oh! Oversight. Thank you.
I also added #if V8_OS
Benedikt Meurer
2013/11/19 07:01:27
sysconf(_SC_PAGESIZE) just calls getpagesize() for
|
| + return static_cast<size_t>(sysconf(_SC_PAGESIZE)); |
| +#else |
| return getpagesize(); |
| +#endif |
| } |