DragonFly kernel List (threaded) for 2003-08
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: __signed usage in ansi.h
Bosko Milekic <bmilekic@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Aug 10, 2003 at 02:07:23PM -0700, Matthew Dillon wrote:
> ...
>> What we can't do is replace things like '__inline' with 'inline'. We
>> need to keep __inline intact in order to maintain compatibility with
>> compilers that do not support inlining (where one can #define __inline
>> to nothing and the code then becomes static-like). It is simply too
>> dangerous to force those environments to define 'inline' to nothing,
>> which is why __inline exists.
>
> Note that even if you do support such compilers you're probably in
> trouble as some inlines are defined in header files which, if they are
> not kept as inlines, will lead to needless re-definition and possibly
> some re-definition fatal to the compile.
The function might not end up being inline in a very large number of cases
(options specified to compiler being a start) - you cannot rely on inline
functions being inlined, and even "obvious" to be beneficial inlines can
stop being such when profiling feedback and/or multifile/full program
compilation is used. Inlining assumes all function calls cost the same
and that function entry/exit is a relatively expensive operation and that
the inlined function will run as fast as the non-inlined version. This
might not be true.
>
>> -Matt
>
--
Sander
+++ Out of cheese error +++
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]