/[pcsx2_0.9.7]/trunk/common/src/x86emitter/LnxCpuDetect.cpp
ViewVC logotype

Diff of /trunk/common/src/x86emitter/LnxCpuDetect.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/common/src/x86emitter/LnxCpuDetect.cpp	2010/12/23 11:48:33	279
+++ trunk/common/src/x86emitter/LnxCpuDetect.cpp	2010/12/23 12:02:12	280
@@ -16,24 +16,16 @@
 
 #include "PrecompiledHeader.h"
 #include "cpudetect_internal.h"
+#include <wx/thread.h>
 
 // Note: Apparently this solution is Linux/Solaris only.
 // FreeBSD/OsX need something far more complicated (apparently)
 void x86capabilities::CountLogicalCores()
 {
-	const uint numCPU = sysconf( _SC_NPROCESSORS_ONLN );
-	if( numCPU > 0 )
-	{
-		//isMultiCore = numCPU > 1;
-		LogicalCores = numCPU;
-		PhysicalCores = ( numCPU / LogicalCoresPerPhysicalCPU ) * PhysicalCoresPerPhysicalCPU;
-	}
-	else
-	{
-		// Indeterminate?
-		LogicalCores = 1;
-		PhysicalCores = 1;
-	}
+	// Note : GetCPUCount uses sysconf( _SC_NPROCESSORS_ONLN ) internally, which can return 1
+	// if sysconf info isn't available (a long standing linux bug).  There are no fallbacks or
+	// alternatives, apparently.
+	LogicalCores = wxThread::GetCPUCount();
 }
 
 bool CanEmitShit()

 

  ViewVC Help
Powered by ViewVC 1.1.22