[Ocfs2-devel] [PATCH]2.6 mechanism for holding private inode data

Mark Fasheh mark.fasheh at oracle.com
Mon Mar 15 13:54:57 CST 2004


On Fri, Mar 12, 2004 at 03:39:42PM -0800, Villalovos, John L wrote:
> Just curious on why you would ever want to use macros over inline
> functions?  I'll be honest and express my prejudice against macros right
> here and now :)  Since the compiler will convert an inline function into
> the exact same thing as a macro and you get type checking and
> predicatable behavior with a inline function.
Well, better a prejudice against macros, than a bias *towards* using them.
I've seen that before, and it ain't pretty :)
Mainly, for one liners which don't require typechecking, I find macros
easier to read -- there's less on the page there, especially when you've got
a bunch of said macros defined right after another -- compare Rusty's older
inode patch against the macro definitions we've got. Ok, maybe *those*
particular macros aren't the best example, but you get my point!  :)

Also, Manish tells me that using a macro in that case reduces gcc's working
set (though that's not really much of an issue).
	--Mark

--
Mark Fasheh
Software Developer, Oracle Corp
mark.fasheh at oracle.com


More information about the Ocfs2-devel mailing list