[CRIU] [crtools-bot for Cyrill Gorcunov ] compiler: Add likely/unlikely hints

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 28 10:13:46 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 7b4c352be3a203d7763c4660eac8e5ed3e449c2b
Author: Cyrill Gorcunov <gorcunov at openvz.org>
Date:   Fri Feb 24 15:12:38 2012 +0400

    compiler: Add likely/unlikely hints
    
    Will be needed for file-ids handling.
    
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
    Acked-by: Pavel Emelyanov <xemul at parallels.com>
---
 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


More information about the CRIU mailing list