[Ffmpeg-devel] New inlining warnings in SVN

Guillaume POIRIER poirierg
Mon Sep 4 15:18:15 CEST 2006


Hi,

On 9/4/06, ?smail D?nmez <ismail at pardus.org.tr> wrote:
> Pazartesi 4 Eyl?l 2006 14:46 tarihinde, Guillaume POIRIER ?unlar? yazm??t?:

[..]

> Seems like there is some missed inlining opportunities missed or some
> excessive inlining going on.

That's because the compiler is free do to whatever it wants when you
write smth such as:

inline int myfunc() { }

It doesn't have to inline myfunc(), but it is biased towards inlining
it thanks to the keyword.
For instance, a long function may not be inline, while a short
function has a great chance to be inlined.

Note that AFAIK, this is the meaning of "inline" in the C standard,
it's not a strange behaviour of some broken compilers.

This is what the norm has to say:

1519 Making a function an inline function suggests that calls to the
function be as fast as possible.118)

1520 The extent to which such suggestions are effective is
implementation-defined.119)

That's why there's the GNU extension __alway_inline__ (if it's not
gnu, then it's not standard at least), and this extension does what it
means: it forces to compiler to always inline the functions marked as
such.

Also, the compiler is free to inline a function if it feels that it
will be benefical, even if it's not been asked to.

Guillaume
-- 
A thing is not necessarily true because a man dies for it.
-- Oscar Wilde



More information about the ffmpeg-devel mailing list