From: Samuel Thibault <samuel.thibault@gnu.org>
To: Sergey Bugaev <bugaevc@gmail.com>
Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org
Subject: Re: [PATCH] cdefs.h: Define __COLD
Date: Sat, 29 Apr 2023 17:02:18 +0200 [thread overview]
Message-ID: <20230429150218.j5s65rd7wdshwhxs@begin> (raw)
In-Reply-To: <20230429132053.2508965-1-bugaevc@gmail.com>
Applied, thanks!
Sergey Bugaev, le sam. 29 avril 2023 16:20:53 +0300, a ecrit:
> And of course right after I have sent it, I notice that I forgot the
> "Not GCC or clang." case.
>
> Sergey
>
> -- >8 --
>
> From 1b8c6563828399de563846525d0f525001f2d80d Mon Sep 17 00:00:00 2001
> From: Sergey Bugaev <bugaevc@gmail.com>
> Date: Thu, 27 Apr 2023 17:42:11 +0300
> Subject: [PATCH] cdefs.h: Define __COLD
>
> This expands to __attribute__ ((cold)) when supported. It should be
> used to mark up functions that are invoked rarely.
>
> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
> ---
> misc/sys/cdefs.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
> index 23ec0ebd..9a07e297 100644
> --- a/misc/sys/cdefs.h
> +++ b/misc/sys/cdefs.h
> @@ -98,6 +98,12 @@
> # endif
> # endif
>
> +# if __GNUC_PREREQ (4, 3) || __glibc_has_attribute (__cold__)
> +# define __COLD __attribute__ ((__cold__))
> +# else
> +# define __COLD
> +# endif
> +
> #else /* Not GCC or clang. */
>
> # if (defined __cplusplus \
> @@ -110,6 +116,7 @@
> # define __THROW
> # define __THROWNL
> # define __NTH(fct) fct
> +# define __COLD
>
> #endif /* GCC || clang. */
>
> --
> 2.40.1
>
--
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.
prev parent reply other threads:[~2023-04-29 15:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-29 13:12 [PATCH 1/3] " Sergey Bugaev
2023-04-29 13:12 ` [PATCH 2/3] hurd: Mark error functions as __COLD Sergey Bugaev
2023-04-29 15:04 ` Samuel Thibault
2023-04-29 13:12 ` [PATCH 3/3] Mark various cold " Sergey Bugaev
2023-04-29 15:06 ` Samuel Thibault
2023-05-01 16:15 ` Siddhesh Poyarekar
2023-05-01 17:38 ` Samuel Thibault
2023-05-01 21:52 ` Cristian Rodríguez
2023-05-01 21:54 ` Samuel Thibault
2023-05-02 6:45 ` Sergey Bugaev
2023-04-29 13:20 ` [PATCH] cdefs.h: Define __COLD Sergey Bugaev
2023-04-29 15:02 ` Samuel Thibault [this message]
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=20230429150218.j5s65rd7wdshwhxs@begin \
--to=samuel.thibault@gnu.org \
--cc=bug-hurd@gnu.org \
--cc=bugaevc@gmail.com \
--cc=libc-alpha@sourceware.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).