diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-11-18 13:03:34 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-11-18 13:03:34 +0000 |
commit | ba203ef1916dc426afb4a069b00fe7cbed3cd8d9 (patch) | |
tree | 817f68d251811fcf8b2deb8aa30e841e2b7d0ed4 /include | |
parent | a5988ffad4a20bca7cc28d71c24cce42c0f7e835 (diff) |
- add __hot and __cold annotations
Will spare us quite some likely()/unlikely() occurances.
See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html for details
Diffstat (limited to 'include')
-rw-r--r-- | include/libc-symbols.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libc-symbols.h b/include/libc-symbols.h index dacc03cf9..64dcf2c07 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -63,6 +63,14 @@ #ifndef unlikely # define unlikely(x) __builtin_expect((!!(x)),0) #endif +#if defined __GNUC__ && !(__GNUC__ == 4 && __GNUC_MINOR__ < 3) +# ifndef __cold +# define __cold __attribute__ ((__cold__)) +# endif +# ifndef __hot +# define __hot __attribute__ ((__hot__)) +# endif +#endif #ifndef __LINUX_COMPILER_H # define __LINUX_COMPILER_H #endif |