Brent Fulgham <[EMAIL PROTECTED]> writes:
>> > Having thought about it a bunch more (because of this) I'm
>> > proposing we let the compiler decide. The caller doesn't
>> > know enough to make that decision.
>>
>> Read carefully. I said we *let* the caller decide, not *make* the
>> caller decide. What, specifically, disturbs you about my proposal?
>>
>
>The 'inline' keyword is just a hint to the compiler. If optimization
>is turned off, no inlining is done. If optimization is on, the
>compiler may or may not decide to inline. Performance on different
>compilers will vary.
>
>To repeat: Even if I say "inline" on everything, the compiler is
>free to disregard that if its optimization routines decide not to.
>(Also, if I fail to say "inline" on something, the compiler may
>decide to inline if optimization is active).
>
>So aren't we all saying the same thing?
I don't think so - it is a question which way we code the source:
A. Use 'inline' every where and trust compiler not to do what we told it
if it knows better.
B. No inline hints in the source and trust the compiler to be able to
do the right thing when prodded with -O9 or whatever.
C. Make "informed" guesses at to which calls should be inlined.
My view is that (B) is the way to go, aiming for (C) eventually, because
(A) gives worst-case cache purging.
>
>-Brent
--
Nick Ing-Simmons