Created
December 24, 2014 09:05
-
-
Save airekans/0bcf50b98d612466e0a6 to your computer and use it in GitHub Desktop.
likely/unlikely macro in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef HAVE_BUILTIN_EXPECT | |
#define LIKELY(x) __builtin_expect(!!(x), 1) | |
#define UNLIKELY(x) __builtin_expect(!!(x), 0) | |
#else | |
#define LIKELY(x) (x) | |
#define UNLIKELY(x) (x) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment