2 // Copyright (C) 2007, 2008 Tim Blechmann
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_LOCKFREE_BRANCH_HINTS_HPP_INCLUDED
9 #define BOOST_LOCKFREE_BRANCH_HINTS_HPP_INCLUDED
14 /** \brief hint for the branch prediction */
15 inline bool likely(bool expr
)
18 return __builtin_expect(expr
, true);
24 /** \brief hint for the branch prediction */
25 inline bool unlikely(bool expr
)
28 return __builtin_expect(expr
, false);
34 } /* namespace detail */
35 } /* namespace lockfree */
36 } /* namespace boost */
38 #endif /* BOOST_LOCKFREE_BRANCH_HINTS_HPP_INCLUDED */