Adding M_HOT_ATTRIBUTE

This commit is contained in:
Patrick Pelissier committed 2024-05-07 10:05:23 +02:00
1 parent e787b64978
commit 29fe80a6af
1 file changed
+4 -2
+4 -2
View File
@@ -132,11 +132,13 @@
# define M_ATTR_NO_RETURN
#endif
/* The cold attribute on functions is used to inform the compiler
that the function is unlikely to be executed. */
/* The hot/cold attribute on functions is used to inform the compiler
that the function is likely/unlikely to be executed. */
#if defined(__GNUC__)
# define M_ATTR_HOT_FUNCTION __attribute__ ((hot))
# define M_ATTR_COLD_FUNCTION __attribute__ ((cold))
#else
# define M_ATTR_HOT_FUNCTION
# define M_ATTR_COLD_FUNCTION
#endif