emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changes in GC and in pure space


From: Paul Eggert
Subject: Re: Changes in GC and in pure space
Date: Wed, 4 Sep 2019 12:15:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Óscar Fuentes wrote:
At least in the C++ world, `inline' is used for putting function
definitions on headers, not for inlining.

There is a consensus from many years ago that the compiler is expected
to do the right thing wrt inlining irrespectively of the presence or
ausence of the keyword

Things are a bit different in C. In C, the consensus you mention holds for 'static inline' (where the 'inline' is typically just a noise word nowadays), but it does not hold for the plain 'inline' functions that we're talking about because C requires that if one compilation unit defines a plain 'inline' function, then exactly one other compilation unit must define that function as 'extern inline'.

Emacs rarely uses 'static inline', due to the consensus that you mention. In the few exceptions where Emacs does use 'static inline', I vaguely recall there being performance advantages when compiled by GCC in typical platforms, as GCC does not ignore the 'inline' in these exceptional situations.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]