Skip to content

Commit

Permalink
Adding M_HOT_ATTRIBUTE
Browse files Browse the repository at this point in the history
  • Loading branch information
P-p-H-d committed May 7, 2024
1 parent e787b64 commit 29fe80a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions m-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 29fe80a

Please sign in to comment.