On Tue, Oct 04, 2005 at 12:37:51AM +0100, Simon Riggs wrote: > On Mon, 2005-10-03 at 23:25 +0200, Martijn van Oosterhout wrote: > > Please note: if inlineApplySortFunction() is actually inlined (it isn't > > by default) > > Can you explain your last post some more. Thats not what I get.
The inline keyword is just a flag that you would like the compiler to inline it. GCC will decide itself. It has a limit on the size of functions that it will consider for inlining. Quote the gcc manual: -finline-limit-N By default, gcc limits the size of functions that can be inlined. This flag allows the control of this limit for functions that are explicitly marked as inline (ie marked with the inline keyword or defined within the class definition in c++). N is the size of functions that can be inlined in number of pseudo instructions (not counting parameter handling). It goes in to say that the limit is 10000 for gcc 2.95, but if you examine the manual for gcc 3.3 it has the limit at 600. So it's entirely possible that at the time the person wrote that code, it *was* being inlined, but it sure isn't on some versions of some compilers. I experimented and found that -finline-limit-1500 causes it to start inlining. The -Winline flag causes gcc to print a warning if you specified "inline" but gcc didn't inline it, for whatever reason. Hopefully this clears that up. -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
pgpSmmXmACi5l.pgp
Description: PGP signature