Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Unified Diff: base/process/process_metrics_win.cc

Issue 2558043007: Fix free memory calculation. (Closed)
Patch Set: Fix integer overflow in unittest. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_metrics_unittest.cc ('k') | base/sys_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_win.cc
diff --git a/base/process/process_metrics_win.cc b/base/process/process_metrics_win.cc
index d2f0c935531071a092289637b9696a744c22ea9a..6f1fe13f1fa0dd4c11dff42b6285bce6e7b52f83 100644
--- a/base/process/process_metrics_win.cc
+++ b/base/process/process_metrics_win.cc
@@ -31,12 +31,6 @@ typedef NTSTATUS(WINAPI* NTQUERYSYSTEMINFORMATION)(
} // namespace
-SystemMemoryInfoKB::SystemMemoryInfoKB()
- : total(0), free(0), swap_total(0), swap_free(0) {}
-
-SystemMemoryInfoKB::SystemMemoryInfoKB(const SystemMemoryInfoKB& other) =
- default;
-
ProcessMetrics::~ProcessMetrics() { }
// static
@@ -349,7 +343,7 @@ size_t GetPageSize() {
// This function uses the following mapping between MEMORYSTATUSEX and
// SystemMemoryInfoKB:
// ullTotalPhys ==> total
-// ullAvailPhys ==> free
+// ullAvailPhys ==> avail_phys
// ullTotalPageFile ==> swap_total
// ullAvailPageFile ==> swap_free
bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
@@ -359,7 +353,7 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
return false;
meminfo->total = mem_status.ullTotalPhys / 1024;
- meminfo->free = mem_status.ullAvailPhys / 1024;
+ meminfo->avail_phys = mem_status.ullAvailPhys / 1024;
meminfo->swap_total = mem_status.ullTotalPageFile / 1024;
meminfo->swap_free = mem_status.ullAvailPageFile / 1024;
« no previous file with comments | « base/process/process_metrics_unittest.cc ('k') | base/sys_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698