Re: NSLog a No-Op Probably Explained
Re: NSLog a No-Op Probably Explained
- Subject: Re: NSLog a No-Op Probably Explained
- From: Jens Ayton <email@hidden>
- Date: Sun, 20 Dec 2009 13:57:42 +0100
On Dec 20, 2009, at 11:01, Chris Suter wrote:
> On Sun, Dec 20, 2009 at 8:55 PM, Thomas Wetmore <email@hidden> wrote:
>>
>> It is my absolute expectation that dyld_stub_NSLog follows C argument evaluation semantics. However, the argument evaluation time of the format string being passed to NSLog is not the time when the description methods are called. They are called from within the NSLog function. dyld_stub_NSLog is a function in the Objective-C runtime and could easily check the run-time stack and discover another call to itself higher in the chain and simply return. However, as I stated, I only know the results, not the true cause.
>
> Well, you can probably find the source code for it. NSLog ends up
> calling CFLog, which you’ll find is available at opensource.apple.com.
Indeed. CFUtilities.c (http://opensource.apple.com/source/CF/CF-550.13/CFUtilities.c), line 766 (in _CFLogvEx):
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
if (pthread_getspecific(__CFTSDKeyIsInCFLog)) return;
pthread_setspecific(__CFTSDKeyIsInCFLog, (void *)1);
#endif
--
Jens Ayton
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden