Sfoglia il codice sorgente

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
KWSys Upstream 6 anni fa
parent
commit
8372c05472
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      SystemInformation.cxx

+ 2 - 1
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);
   }