Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sysctlbyname( "hw.availcpu" ) fails



On Jun 29, 2007, at 2:39 PM, Eric Schlegel wrote:
On Jun 29, 2007, at 2:34 PM, Steve Checkoway wrote:
Then there are other indications like <http://developer.apple.com/samplecode/CPUGestalt/index.html > which has an interesting warning.

I think that's mostly because we never recommend that you use the specific CPU type to make decisions about code paths. It doesn't matter whether you're getting the cputype from Gestalt or sysctlbyname, it's still better to use CPU capabilities rather than CPU types.

Specifically, certain CPU capabilities can be disabled at runtime, so your software should not assume those capabilities are present merely because you've been able to identify the CPU.


My standard example of this is that it's possible to disable Altivec on PPC systems, and in so doing, test that the code will/won't run on a G3 system, to make sure you didn't make a mistake in code generation. It's also possible on Intel for specific features to be enabled/disabled on various models and steppings as a result of EFI or Platform Expert updates.

-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: sysctlbyname( "hw.availcpu" ) fails (From: Michael Smith <email@hidden>)
 >Re: sysctlbyname( "hw.availcpu" ) fails (From: Steve Checkoway <email@hidden>)
 >Re: sysctlbyname( "hw.availcpu" ) fails (From: Eric Schlegel <email@hidden>)
 >Re: sysctlbyname( "hw.availcpu" ) fails (From: Steve Checkoway <email@hidden>)
 >Re: sysctlbyname( "hw.availcpu" ) fails (From: Eric Schlegel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.