On Jan. 22, 2008, 18:06 +0200, Rick Macklem <[EMAIL PROTECTED]> wrote: >>> They should really be converted into inlined functions. >>> >>> Cheers >>> Trond >> Agreed. How about the following: > > Ok, you've tickled my curiosity...why? Unless a macro is large and is > used many times (my really old nfs code was like that, being written > for a compiler that didn't support inline functions), what is the > advantage of inline functions? Or is it just that the code is more readable?
Let me quote Jeff Garzik in http://lwn.net/2000/1123/a/Linus-HOWTO.php3: 3) 'static inline' is better than a macro Static inline functions are greatly preferred over macros. They provide type safety, have no length limitations, no formatting limitations, and under gcc they are as cheap as macros. Macros should only be used for cases where a static inline is clearly suboptimal [there a few, isolated cases of this in fast paths], or where it is impossible to use a static inline function [such as string-izing]. So for zero cost in performance you get safer, scope isolated, and more readable code. Benny > > Just curious, I don't have any problem with using inline functions, rick - To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
