Re: Dead Reckoning
Re: Dead Reckoning
- Subject: Re: Dead Reckoning
- From: Jens Alfke <email@hidden>
- Date: Fri, 09 Oct 2015 21:54:36 -0700
> On Oct 9, 2015, at 9:24 PM, Graham Cox <email@hidden> wrote:
>
> Does it actually replace a function call with an inline constant multiply?
Sure. With optimizations enabled, the compiler is likely to inline the function calls, which will turn them into a simple multiplication. (This applies to any of C, Obj-C, C++, or Swift.) In C-based languages you can use the “inline” keyword to further encourage the compiler.
There’s very little reason to use macros for things like this, when an inline function is as efficient and safer.
—Jens
_______________________________________________
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