From b4516b49df1d470f59fe207135ef8f6552e394f4 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Fri, 23 Jan 2015 23:34:03 -0800 Subject: [PATCH] Add general-use branch-prediction macros --- src/common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common.h b/src/common.h index 41322c5f..fc56c1cb 100644 --- a/src/common.h +++ b/src/common.h @@ -203,4 +203,8 @@ extern FILE *error_log; } while (0) #endif +// branch prediction +#define LIKELY(x) __builtin_expect((x), true) +#define UNLIKELY(x) __builtin_expect((x), false) + #endif // whole file