Drawing the line on inline
Posted Jan 16, 2006 21:34 UTC (Mon) by roc
Parent article: Drawing the line on inline
One thing that's missing from this discussion is that in many cases you want some invocations of function F to be inlined and other invocations of the same function to NOT be inlined. In particular invocations of F in hot paths should be inlined and invocations in cold, infrequently executed code should not (unless inlining F is actually smaller than a regular function call to F). You can't get this effect just by twiddling 'inline' declarations in the source, so the compiler (perhaps assisted with profile information) can actually do a better job then you can at the source level (unless you go around inline the code by hand in the source code, which is madness).
to post comments)