All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hints.h File Reference
+ Include dependency graph for hints.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define ARCH_LIKELY(x)   (x)
#define ARCH_UNLIKELY(x)   (x)

Detailed Description

Compiler hints.

ARCH_LIKELY(bool-expr) and ARCH_UNLIKELY(bool-expr) will evaluate to the value of bool-expr but will also emit compiler intrinsics providing hints for branch prediction if the compiler has such intrinsics. It is advised that you only use these in cases where you empirically know the outcome of bool-expr to a very high degree of certainty. For example, fatal-error cases, invariants, first-time initializations, etc.

Definition in file hints.h.

Macro Definition Documentation

#define ARCH_LIKELY (   x)    (x)

Definition at line 46 of file hints.h.

#define ARCH_UNLIKELY (   x)    (x)

Definition at line 47 of file hints.h.