Re: [PATCH] Two small corrections to 2.4.0-test1

From: Russell King (rmk@arm.linux.org.uk)
Date: Fri Jun 02 2000 - 07:53:24 EST


Jeff Garzik writes:
> But as for "why", using 'static inline' makes the compiler try its best
> to avoid the problem of inlining sometimes not getting done, i.e. try
> even harder than 'extern inline'.

How does it?

Reading the GCC info, the difference between "static inline" and "extern inline"
is that "extern" will never generate any code for the out of line case. This
means that any non-unlined calls become external references.

IMHO, this is preferable to including the same code in each file if inlining
does not happen. If this is a problem, what we want to do is to keep the
extern __inline__ fragments in the kernel headers, and provide a library
(in linux/lib?) of the appropriate function code. This way, we only end up
with one copy of the functions code in the kernel, not one per file where
a non-inlined reference occurs.

However, have there been any instances in the kernel when inlining an "extern
inline" have actually failed?
   _____
  |_____| ------------------------------------------------- ---+---+-
  | | Russell King rmk@arm.linux.org.uk --- ---
  | | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
  | +-+-+ --- -+-
  / | THE developer of ARM Linux |+| /|\
 / | | | --- |
    +-+-+ ------------------------------------------------- /\\\ |

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



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:15 EST