ENH: use GlobalMemoryStatusEx as it is able to report more than 2gigs

This commit is contained in:
Bill Hoffman 2008-05-02 11:44:26 -04:00
parent 36cf25e6a2
commit 9c63132c3c
1 changed files with 6 additions and 6 deletions

View File

@ -2228,13 +2228,13 @@ int SystemInformationImplementation::QueryMemory()
#ifdef __CYGWIN__ #ifdef __CYGWIN__
return 0; return 0;
#elif _WIN32 #elif _WIN32
MEMORYSTATUS ms; MEMORYSTATUSEX ms;
GlobalMemoryStatus(&ms); GlobalMemoryStatusEx(&ms);
unsigned long tv = ms.dwTotalVirtual; unsigned long tv = ms.ullTotalVirtual;
unsigned long tp = ms.dwTotalPhys; unsigned long tp = ms.ullTotalPhys;
unsigned long av = ms.dwAvailVirtual; unsigned long av = ms.ullAvailVirtual;
unsigned long ap = ms.dwAvailPhys; unsigned long ap = ms.ullAvailPhys;
this->TotalVirtualMemory = tv>>10>>10; this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10; this->TotalPhysicalMemory = tp>>10>>10;
this->AvailableVirtualMemory = av>>10>>10; this->AvailableVirtualMemory = av>>10>>10;