Index: src/platform-macos.cc |
diff --git a/src/platform-macos.cc b/src/platform-macos.cc |
index a58bc1aca3943184d0185246c5498a060b90149b..3b273b6120a585eb1633ee110e608e745154c405 100644 |
--- a/src/platform-macos.cc |
+++ b/src/platform-macos.cc |
@@ -202,6 +202,19 @@ void OS::SignalCodeMovingGC() { |
} |
+uintptr_t OS::TotalPhysicalMemory() { |
+ int mib[2]; |
+ mib[0] = CTL_HW; |
+ mib[1] = HW_MEMSIZE; |
+ int64_t size = 0; |
+ size_t len = sizeof(size); |
+ if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) |
+ return static_cast<uintptr_t> size; |
+ UNREACHABLE(); |
+ return 0; |
+} |
+ |
+ |
const char* OS::LocalTimezone(double time) { |
if (std::isnan(time)) return ""; |
time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |