lkml.org 
[lkml]   [2000]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux-2.4.0-test9-pre2


On Mon, 18 Sep 2000, Chris Wedgwood wrote:

> On Sun, Sep 17, 2000 at 10:37:51AM -0700, Linus Torvalds wrote:
>
> - "extern inline" -> "static inline". It doesn't matter right now,
> but it's proactive for future gcc versions.
>
> can someone please explain the difference?

Let's assume that gcc decides that it won't inline a function, because
it's too "big", according to some gcc definition of "big".

With "extern inline", the function will not exist AT ALL, and you'll end
up getting a link-time error complaining about the lack of that function.

With "static inline", gcc will emit the function as a separate function
for that compilation block if it didn't get inlined.

Both are valid things. You use "extern inline" when you have a "backing
store" for the funcion (ie you do have the non-inlined version in a
library somewhere). You use "static inline" when you don't.

For the kernel, we very seldom have the non-inlined versions in any
library, so for the kernel "extern inline" is almost always the wrong
thing.

Note that with most versions of gcc this is all a complete non-issue, as
most versions of gcc will _always_ inline a function that the user has
asked to be inlined. So the issue seldom actually comes up.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.140 / U:2.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site