Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSLog a No-Op Probably Explained
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog a No-Op Probably Explained



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

References: 
 >NSLog a No-Op Probably Explained (From: Thomas Wetmore <email@hidden>)
 >Re: NSLog a No-Op Probably Explained (From: Thomas Wetmore <email@hidden>)
 >Re: NSLog a No-Op Probably Explained (From: Chris Suter <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.