• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inline C functions in Xcode 3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inline C functions in Xcode 3


  • Subject: Re: Inline C functions in Xcode 3
  • From: Vincent Coetzee <email@hidden>
  • Date: Sun, 4 Nov 2007 02:21:15 +0200

Dear List,

This may also be off-topic and maybe I have missed this if it was covered earlier in the discussion but could someone explain to dumb little me why it is not possible to mark Objective-C methods as inline ? I do understand the way the runtime works and see several simple modifications to even late bound code that would allow this to function correctly and be used in some cases for significant performance optimisations.

TIA

Vince

On 04 Nov 2007, at Sunday 04/11/200700:21 , Steve Checkoway wrote:


On Nov 3, 2007, at 1:59 PM, Eric Albert wrote:

I'd strongly advise against using either FOUNDATION_STATIC_INLINE or CF_INLINE. Neither is supported for anything other than Foundation or CF's uses. They may work for you, but the Foundation and CF engineers may change them at any point.


Speaking of inline, what is the difference (if any) between __inline, __inline__, and __attribute__((always_inline))? Looking at the definitions of CF_INLINE, I see:

#if defined(__GNUC__) && (__GNUC__ == 4) && !defined(DEBUG)
#define CF_INLINE static __inline__ __attribute__((always_inline))
#elif defined(__GNUC__)
#define CF_INLINE static __inline__
#elif defined(__MWERKS__) || defined(__cplusplus)
#define CF_INLINE static inline
#elif defined(_MSC_VER)
#define CF_INLINE static __inline
#elif defined(__WIN32__)
#define CF_INLINE static __inline__
#endif


Why this header using __inline__ __attribute__((always_inline)) for gcc 4.x?

Both C++98 and C99 include an inline keyword and they seem to be about the same--as opposed to how gcc, at least, treats inline in C89 vs. C99. Is there a reason to use __inline or __inline__ (both of which do work with gcc) instead of inline?

I know these questions aren't really appropriate for Xcode-users and I apologize, but there is still no more appropriate list. (I filed a bug a year ago requesting the creation of such a list but was told that that was the wrong place to do so but that my feedback had been forwarded to "the appropriate group for review & consideration.")

--
Steve Checkoway



_______________________________________________
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

_______________________________________________ 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
  • Follow-Ups:
    • Re: Inline C functions in Xcode 3
      • From: Chris Hanson <email@hidden>
References: 
 >Inline C functions in Xcode 3 (From: David Riggle <email@hidden>)
 >Re: Inline C functions in Xcode 3 (From: Nick Zitzmann <email@hidden>)
 >Re: Inline C functions in Xcode 3 (From: Michael Nickerson <email@hidden>)
 >Re: Inline C functions in Xcode 3 (From: Eric Albert <email@hidden>)
 >Re: Inline C functions in Xcode 3 (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: Interface Builder 3 & Core Animation: it doesn't seem to be usable
  • Next by Date: Re: Inline C functions in Xcode 3
  • Previous by thread: Re: Inline C functions in Xcode 3
  • Next by thread: Re: Inline C functions in Xcode 3
  • Index(es):
    • Date
    • Thread