| Index: src/platform-linux.cc
|
| diff --git a/src/platform-linux.cc b/src/platform-linux.cc
|
| index 74d473f4a125091038a48981037db56900676940..0c910638c1f077f94cd415bda61fefe6b0437bdb 100644
|
| --- a/src/platform-linux.cc
|
| +++ b/src/platform-linux.cc
|
| @@ -313,6 +313,17 @@ void OS::SignalCodeMovingGC() {
|
| }
|
|
|
|
|
| +uintptr_t OS::TotalPhysicalMemory() {
|
| + intptr_t pages = sysconf(_SC_PHYS_PAGES);
|
| + intptr_t page_size = sysconf(_SC_PAGESIZE);
|
| + if (pages == -1 || page_size == -1) {
|
| + UNREACHABLE();
|
| + return 0;
|
| + }
|
| + return static_cast<uintptr_t>(pages) * page_size;
|
| +}
|
| +
|
| +
|
| // Constants used for mmap.
|
| static const int kMmapFd = -1;
|
| static const int kMmapFdOffset = 0;
|
|
|