From: Matt Armstrong <matt@rfc20.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs' C: static inline considered useless nowadays?
Date: Mon, 17 Oct 2022 13:33:18 -0700 [thread overview]
Message-ID: <874jw26vht.fsf@rfc20.org> (raw)
In-Reply-To: <83ilki1cyo.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Matt Armstrong <matt@rfc20.org>
>> Cc: emacs-devel@gnu.org
>> Date: Mon, 17 Oct 2022 12:08:38 -0700
>>
>> > 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.
>
> Why would you need 'inline' anywhere else?
That is the question I started the thread with, in different words. If
you grep our sources 'static inline' appears in .c files, and I wondered
why.
Stefan gave an answer in the form of a question (he was concerned about
what gcc did at optimization level -Og). I investigated and found that
gcc (and clang) will inline a static function at -Og level only if the
function uses the inline keyword. So a "static inline" function is
useful in the case where you want some key static functions inlined, but
everything else still relatively unoptimized.
next prev parent reply other threads:[~2022-10-17 20:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 22:08 Emacs' C: static inline considered useless nowadays? Matt Armstrong
2022-10-17 0:43 ` Stefan Monnier
2022-10-17 3:13 ` Matt Armstrong
2022-10-17 3:33 ` Óscar Fuentes
2022-10-17 6:10 ` Eli Zaretskii
2022-10-17 19:08 ` Matt Armstrong
2022-10-17 19:12 ` Eli Zaretskii
2022-10-17 20:33 ` Matt Armstrong [this message]
2022-10-18 2:30 ` Eli Zaretskii
2022-10-18 13:32 ` Stefan Monnier
2022-10-18 15:09 ` Eli Zaretskii
2022-10-18 17:01 ` tomas
2022-10-18 19:22 ` Stefan Monnier
2022-10-18 19:31 ` Eli Zaretskii
2022-10-18 11:58 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874jw26vht.fsf@rfc20.org \
--to=matt@rfc20.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.