[Cmake-commits] [cmake-commits] hoffman committed SystemInformation.cxx 1.22.2.1 1.22.2.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Sun May 4 18:07:29 EDT 2008
Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv19477/Source/kwsys
Modified Files:
Tag: CMake-2-6
SystemInformation.cxx
Log Message:
ENH: merge from main tree
Index: SystemInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemInformation.cxx,v
retrieving revision 1.22.2.1
retrieving revision 1.22.2.2
diff -C 2 -d -r1.22.2.1 -r1.22.2.2
*** SystemInformation.cxx 1 May 2008 16:35:40 -0000 1.22.2.1
--- SystemInformation.cxx 4 May 2008 22:07:27 -0000 1.22.2.2
***************
*** 800,805 ****
bool SystemInformationImplementation::DoesCPUSupportCPUID()
{
- int CPUIDPresent = 0;
-
#if USE_ASM_INSTRUCTIONS
// Use SEH to determine CPUID presence
--- 800,803 ----
***************
*** 830,842 ****
{
// Stop the class from trying to use CPUID again!
- CPUIDPresent = false;
return false;
}
#else
! CPUIDPresent = false;
#endif
-
- // Return true to indicate support or false to indicate lack.
- return (CPUIDPresent == 0) ? true : false;
}
--- 828,840 ----
{
// Stop the class from trying to use CPUID again!
return false;
}
+
+ // The cpuid instruction succeeded.
+ return true;
#else
! // Assume no cpuid instruction.
! return false;
#endif
}
***************
*** 2231,2241 ****
return 0;
#elif _WIN32
MEMORYSTATUS ms;
GlobalMemoryStatus(&ms);
!
! unsigned long tv = ms.dwTotalVirtual;
! unsigned long tp = ms.dwTotalPhys;
! unsigned long av = ms.dwAvailVirtual;
! unsigned long ap = ms.dwAvailPhys;
this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10;
--- 2229,2245 ----
return 0;
#elif _WIN32
+ #if _MSC_VER < 1300
MEMORYSTATUS ms;
GlobalMemoryStatus(&ms);
! #define MEM_VAL(value) dw##value
! #else
! MEMORYSTATUSEX ms;
! GlobalMemoryStatusEx(&ms);
! #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);
this->TotalVirtualMemory = tv>>10>>10;
this->TotalPhysicalMemory = tp>>10>>10;
***************
*** 2587,2591 ****
unsigned int i = 1;
unsigned char PHY_ID_MASK = 0xFF;
! unsigned char PHY_ID_SHIFT = 0;
while (i < this->NumberOfLogicalCPU)
--- 2591,2595 ----
unsigned int i = 1;
unsigned char PHY_ID_MASK = 0xFF;
! //unsigned char PHY_ID_SHIFT = 0;
while (i < this->NumberOfLogicalCPU)
***************
*** 2593,2597 ****
i *= 2;
PHY_ID_MASK <<= 1;
! PHY_ID_SHIFT++;
}
--- 2597,2601 ----
i *= 2;
PHY_ID_MASK <<= 1;
! // PHY_ID_SHIFT++;
}
***************
*** 2923,2927 ****
BOOL bIsWindows64Bit;
BOOL bOsVersionInfoEx;
! char * operatingSystem = new char [256];
// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
--- 2927,2931 ----
BOOL bIsWindows64Bit;
BOOL bOsVersionInfoEx;
! char operatingSystem[256];
// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
***************
*** 3118,3123 ****
break;
}
- delete [] operatingSystem;
- operatingSystem = 0;
// Get the hostname
--- 3122,3125 ----
More information about the Cmake-commits
mailing list