[vlc-devel] commit: Compiler knows better when to inline or not ( R??mi Denis-Courmont )

Rémi Denis-Courmont remi at remlab.net
Tue Jun 30 10:59:02 CEST 2009

On Tue, 30 Jun 2009 10:32:41 +0200, jpd at videolan.org wrote:
> On Mon, Jun 29, 2009 at 05:38:44PM +0200, git version control wrote:
>> vlc | branch: master | R??mi Denis-Courmont <remi at remlab.net> | Mon Jun
> 29 18:23:53 2009 +0300| [05db60da2ec9dc4369817b6a67426f53483d79b5] |
> committer: R??mi Denis-Courmont
>> Compiler knows better when to inline or not
> AFAIK it won't inline without an inline keyword in C (please correct me
> I'm wrong)

That depends on the compiler and its settings. AFAIK a *static* function
can be inlined so long as it is not used as a pointer.

GCC puts "small" functions in-line at -O2, and "simple" functions at -O3.
It also has a self-explanatory -finline-functions-called-once option.

> but again AFAIK it won't anyway because these functions contain
> static tables.

I fail to see why a static table would forbid inlining (other than
compiler-specific design limitation).

Rémi Denis-Courmont

More information about the vlc-devel mailing list