summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Partyka <dave.partyka@kitware.com>2010-03-26 14:18:24 -0400
committerDave Partyka <dave.partyka@kitware.com>2010-03-26 14:18:24 -0400
commit93458332720dc0c237360d8350c4d16b5d8e68c9 (patch)
treeb654358de859048017181fbdcd51fd1fad75c79f
parente750761857fa2e35ad9630b13606570c561ae829 (diff)
downloadcmake-93458332720dc0c237360d8350c4d16b5d8e68c9.tar.gz
BUG: Commit a fix from Rusty to address incorrectly reported memory queries.
-rw-r--r--Source/kwsys/SystemInformation.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 7041d38e5d..936c1f71ba 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -2395,11 +2395,13 @@ int SystemInformationImplementation::QueryMemory()
#elif _WIN32
#if _MSC_VER < 1300
MEMORYSTATUS ms;
+ unsigned long tv, tp, av, ap;
ms.dwLength = sizeof(ms);
GlobalMemoryStatus(&ms);
-#define MEM_VAL(value) dw##value
+ #define MEM_VAL(value) dw##value
#else
MEMORYSTATUSEX ms;
+ DWORDLONG tv, tp, av, ap;
ms.dwLength = sizeof(ms);
if (0 == GlobalMemoryStatusEx(&ms))
{
@@ -2407,10 +2409,10 @@ int SystemInformationImplementation::QueryMemory()
}
#define MEM_VAL(value) ull##value
#endif
- unsigned long tv = ms.MEM_VAL(TotalVirtual);
- unsigned long tp = ms.MEM_VAL(TotalPhys);
- unsigned long av = ms.MEM_VAL(AvailVirtual);
- unsigned long ap = ms.MEM_VAL(AvailPhys);
+ tv = ms.MEM_VAL(TotalVirtual);
+ tp = ms.MEM_VAL(TotalPhys);
+ av = ms.MEM_VAL(AvailVirtual);
+ ap = ms.MEM_VAL(AvailPhys);
this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10;
this->AvailableVirtualMemory = av>>10>>10;