summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2019-02-05 12:19:44 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-05 12:20:29 (GMT)
commit8372c054729984a76e3e619b4c28865006d905d0 (patch)
tree593f7cf58a8a4b19ea53f273109381db9032ec3c
parentc22e373a3077a90a4f1ed509774412a0ab82d992 (diff)
downloadCMake-8372c054729984a76e3e619b4c28865006d905d0.zip
CMake-8372c054729984a76e3e619b4c28865006d905d0.tar.gz
CMake-8372c054729984a76e3e619b4c28865006d905d0.tar.bz2
KWSys 2019-02-05 (65802a20)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 65802a20ec4b9a774518151c3f8772e082163601 (master). Upstream Shortlog ----------------- Nicolae Vartolomei (1): d1536b02 macOS: Better approximation for AvailablePhysicalMemory
-rw-r--r--SystemInformation.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index 6c12355..f323efc 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -4424,7 +4424,8 @@ bool SystemInformationImplementation::ParseSysCtl()
&count) == KERN_SUCCESS) {
len = sizeof(value);
err = sysctlbyname("hw.pagesize", &value, &len, KWSYS_NULLPTR, 0);
- int64_t available_memory = vmstat.free_count * value;
+ int64_t available_memory =
+ (vmstat.free_count + vmstat.inactive_count) * value;
this->AvailablePhysicalMemory =
static_cast<size_t>(available_memory / 1048576);
}