[Lldb-commits] [lldb] r176062 - <rdar://problem/13282582>
Han Ming Ong
hanming at apple.com
Mon Feb 25 16:04:29 PST 2013
Author: hanming
Date: Mon Feb 25 18:04:29 2013
New Revision: 176062
URL: http://llvm.org/viewvc/llvm-project?rev=176062&view=rev
Log:
<rdar://problem/13282582>
Really don't call sysctl again when we already have the result.
Modified:
lldb/trunk/tools/debugserver/source/MacOSX/MachTask.cpp
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.cpp?rev=176062&r1=176061&r2=176062&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.cpp Mon Feb 25 18:04:29 2013
@@ -296,8 +296,11 @@ MachTask::GetProfileData ()
static int32_t numCPU = -1;
int32_t mib[] = {CTL_HW, HW_AVAILCPU};
size_t len = sizeof(numCPU);
- if (sysctl(mib, sizeof(mib) / sizeof(int32_t), &numCPU, &len, NULL, 0) != 0)
- return result;
+ if (numCPU == -1)
+ {
+ if (sysctl(mib, sizeof(mib) / sizeof(int32_t), &numCPU, &len, NULL, 0) != 0)
+ return result;
+ }
mach_port_t localHost = mach_host_self();
struct host_cpu_load_info host_info;
More information about the lldb-commits
mailing list