Re: Cocoa et al as HCI usability problem
Re: Cocoa et al as HCI usability problem
- Subject: Re: Cocoa et al as HCI usability problem
- From: Jean-Daniel Dupas <email@hidden>
- Date: Mon, 19 May 2008 11:52:40 +0200
I would be really surpise if it is not. (and the "Show assembly" Xcode
command tell me that I'm right). I think their is no garantee that the
function will be inlined, as the "inline" keyword is just a compiler's
hint, but the NS_INLINE macros is defined like this:
static __inline__ __attribute__((always_inline))
And I'm pretty sure that a function declared like this will really be
inlined and the compiler will not create any symbol for it (except if
you explicitly tell it to create symbol for inline functions). It it
failed to inline it, the compiler will raise an error (try to create a
recusive function with this attribute, and one with only the inline
keyword for example).
You can try to run 'nm' on AppKit. There is nothing like
"NSRectFromCGRect" in the symbol list (And i have also some app that
use this function and run without issue on 10.4).
IMHO, the "Obj-C does not support inline" statement come from the
fact that it's not possible to inline a method (and it's also
meaningless, as it will break the dynamic nature of the language).
Le 19 mai 08 à 10:45, Graham Cox a écrit :
Ah, OK, I'd missed that.
But it raises another question I've been vaguely meaning to ask the
list, but which is pretty minor, so I haven't so far bothered:
If I declare a C function as static inline inside a .m file (just to
be clear, it's C function, not an Obj-C method) does it get inlined?
Someone told me very authoritatively recently that it wouldn't be
compiled inline if it's within a .m file, so the inline keyword was
redundant. I couldn't find anything documenting that either way.
G.
On 19 May 2008, at 5:51 pm, Jean-Daniel Dupas wrote:
It's an inline fonction, so code compiled using this function will
properly work on pre 10.5 versions of the OS.
Le 19 mai 08 à 08:34, Graham Cox a écrit :
Yes, it's not available pre 10.5
G.
On 19 May 2008, at 4:31 pm, Andrew Merenbach wrote:
Is there any reason to use the cast on cbbox, instead of using
NSRectFromCGRect(cbbox)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden