Martin Buchholz <martin(a)xemacs.org> writes:
Hrvoje> It *is* necessary. Some people don't want to use -O3
Hrvoje> because it generates much more code. On the other hand, -O2
Hrvoje> will produce a funcall for each mention of
Hrvoje> digit_to_number(), which I decidedly don't want.
Hrvoje> Using the inline keyword sparingly has the advantage of specifying
Hrvoje> exactly which functions you want inlined, regardless of the
Hrvoje> optimization level.
[...]
>> In fact, inline, like register, is merely a hint to the
compiler.
Hrvoje> There is a difference.
Conceptually, I don't see any difference. Sufficiently good
compilers should obsolete use of register and inline.
There is a big difference, and I will repeat it:
With -O3, you give the compiler free hands to do what it chooses with
inlining the functions. The compiler may be Very Smart, but it cannot
possibly know all the XEmacs context.
On the other hand, with -O2 + inline declarations, you decide against
inlining the functions, except when you say so.
I encourage you to go ahead and experiment with changing functions
which are currently `static' to `static inline'. See what `inline'
is defined to in config.h with your compiler.
I use Gcc, so `inline' does not have a preprocessor definition.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
main(){printf(&unix["\021%six\012\0"],(unix)["have"]+"fun"-0x60);}