Index: src/platform-cygwin.cc |
diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc |
index 5903438932b61ad6eea29c7cac5441bca78c632a..991b402882c6b57b4e7810651414eea0678b2d0d 100644 |
--- a/src/platform-cygwin.cc |
+++ b/src/platform-cygwin.cc |
@@ -205,6 +205,18 @@ void OS::SignalCodeMovingGC() { |
} |
+uintptr_t OS::TotalPhysicalMemory() { |
+ MEMORYSTATUS memory_info; |
+ memory_info.dwLength = sizeof(memory_info); |
+ if (!GlobalMemoryStatus(&memory_info)) { |
+ UNREACHABLE(); |
+ return 0; |
+ } |
+ |
+ return static_cast<uintptr_t>(memory_info.dwTotalPhys); |
+} |
+ |
+ |
// The VirtualMemory implementation is taken from platform-win32.cc. |
// The mmap-based virtual memory implementation as it is used on most posix |
// platforms does not work well because Cygwin does not support MAP_FIXED. |