The nxt_expect() macro.

This commit is contained in:
Valentin Bartenev
2017-04-11 19:28:23 +03:00
parent 60ae0314c0
commit e0881fd85c

View File

@@ -30,17 +30,25 @@ nxt_pragma_loop_disable_vectorization
#if (NXT_HAVE_BUILTIN_EXPECT)
#define \
nxt_expect(c, x) \
__builtin_expect((long) (x), (c))
#define \
nxt_fast_path(x) \
__builtin_expect((long) (x), 1)
nxt_expect(1, x)
#define \
nxt_slow_path(x) \
__builtin_expect((long) (x), 0)
nxt_expect(0, x)
#else
#define \
nxt_expect(c, x) \
(x)
#define \
nxt_fast_path(x) \
(x)