From: Valentin Bartenev Date: Mon, 19 Dec 2016 11:19:43 +0000 (+0300) Subject: The nxt_expect() macro. X-Git-Tag: 0.1.7~3 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=fff3a7ed15cd653ac76e6105ecb3180d871463a3;p=njs.git The nxt_expect() macro. --- diff --git a/nxt/nxt_clang.h b/nxt/nxt_clang.h index aeadb117..32737201 100644 --- a/nxt/nxt_clang.h +++ b/nxt/nxt_clang.h @@ -27,10 +27,12 @@ #if (NXT_HAVE_BUILTIN_EXPECT) -#define nxt_fast_path(x) __builtin_expect((long) (x), 1) -#define nxt_slow_path(x) __builtin_expect((long) (x), 0) +#define nxt_expect(c, x) __builtin_expect((long) (x), (c)) +#define nxt_fast_path(x) nxt_expect(1, x) +#define nxt_slow_path(x) nxt_expect(0, x) #else +#define nxt_expect(c, x) (x) #define nxt_fast_path(x) (x) #define nxt_slow_path(x) (x) #endif