[Top][All Lists]

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

Re: Emacs' C: static inline considered useless nowadays?

From: Matt Armstrong
Subject: Re: Emacs' C: static inline considered useless nowadays?
Date: Mon, 17 Oct 2022 12:08:38 -0700

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Matt Armstrong <matt@rfc20.org>
>> Date: Sun, 16 Oct 2022 15:08:51 -0700
>> For Emacs, I would think:
>> a) In header files, use Emacs' INLINE and NO_INLINE macros.
>> b) In .c files, use static, EXTERN_INLINE, but never 'inline' since it
>> does nothing.
>> I'm seeking confirmation (or refutation) of (a) and (b).  I'm not asking
>> generally, but for Emacs' C code.
> See conf_post.h, around line 395: it explains the issue and the
> expected usage of these in our sources.

conf_post.h didn't answer my question since it seems to pertain to code
in header files.

I realize now that the conclusion of this thread so far is unclear:

a) "static inline" in .c files is okay.  No need for macros.

b) Criteria for when to use "static inline" is not clear.  Do we do this
   ad hoc as -Og builds are discovered to be slow?  Do it for all static
   functions?  Don't care?  I can see cases for any of these.

c) Neither (a) nor (b) are written down, and as Eli points out,
   conf_post.h suggests that at least sometimes you've got to use
   macros for inline functions in Emacs code, but that header is about
   how to do things in header files.

reply via email to

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