Re: inlining and squid-3

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 31 Oct 2002 10:05:16 +0100

Evgeny Kotsuba wrote:
>
> Hi,
> On 30 Oct 2002 23:05:23 +1100
> Robert Collins <robertc@squid-cache.org> wrote:
> >We will likely want to inline many of the trivial methods in squid-3
> >objects.
> >
> >Does extern_inline exist for all C++ compilers? I've a suggestion for
> >inlining that doesn't use extern_inline, but can be trivially
> >modified
> >to do so if desired:
>
> Excuse me, what is extern_inline and how inline can be extern ????

"extern inline" tells the compiler

  This function/method should be inlined if you can. If inlining is
disabled for the compilation unit process the function/method as a
extern function.

"inline" tells the compiler

  This function/method should be inlined if you can. If inlining is
disabled include the function in each compilation unit where this piece
of code is seen.

Some compilers (or actually linkers) are smart, and automatically prunes
out the duplicate code segments caused by "inline" when code-inlining
has been disabled by the compiler, but many don't and leave you with
several duplicates of the same function (one per compilation unit where
the "inline" function was used).

For debugging a inlined function/method we want a single copy of the
function/method so we can set a breakpoint on it.

Regards
Henrik
Received on Thu Oct 31 2002 - 02:05:27 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:17:02 MST