[CRIU] [PATCH 03/10] compiler: Add likely/unlikely hints
Cyrill Gorcunov
gorcunov at openvz.org
Fri Feb 24 18:24:24 EST 2012
Will be needed for file-ids handling.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
include/compiler.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/compiler.h b/include/compiler.h
index aab5d50..c969906 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -23,6 +23,9 @@
# define __always_inline inline __attribute__((always_inline))
#endif
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
#ifndef always_inline
# define always_inline __always_inline
#endif
--
1.7.7.6
More information about the CRIU
mailing list