Chromium Code Reviews| Index: base/sys_info_win.cc |
| diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc |
| index cb184bae2589d607919858bacc4a1969353c5e98..914ce3d39677e291442fd173bae8572f748f2e64 100644 |
| --- a/base/sys_info_win.cc |
| +++ b/base/sys_info_win.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/logging.h" |
| +#include "base/process/process_metrics.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/threading/thread_restrictions.h" |
| #include "base/win/windows_version.h" |
| @@ -68,7 +69,12 @@ int64_t SysInfo::AmountOfPhysicalMemory() { |
| // static |
| int64_t SysInfo::AmountOfAvailablePhysicalMemory() { |
| - return AmountOfMemory(&MEMORYSTATUSEX::ullAvailPhys); |
| + SystemMemoryInfoKB info; |
| + if (!GetSystemMemoryInfo(&info)) { |
| + NOTREACHED(); |
|
danakj
2017/03/10 17:13:49
same
Michael K. (Yandex Team)
2017/03/10 18:22:37
Done.
|
| + return 0; |
| + } |
| + return static_cast<int64_t>(info.available) * 1024; |
| } |
| // static |