public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] cdefs.h: Define __COLD
@ 2023-04-29 15:02 Samuel Thibault
0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2023-04-29 15:02 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0ab341b247fc1c2cd101a87c78f38d2da00c335c
commit 0ab341b247fc1c2cd101a87c78f38d2da00c335c
Author: Sergey Bugaev <bugaevc@gmail.com>
Date: Thu Apr 27 17:42:11 2023 +0300
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>
Diff:
---
misc/sys/cdefs.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 23ec0ebd2a..9a07e297a6 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. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-29 15:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29 15:02 [glibc] cdefs.h: Define __COLD Samuel Thibault
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).