some fixes and optimizations

This commit is contained in:
cathugger 2017-09-27 21:38:15 +03:00
parent 188f821778
commit 9e9468b453
4 changed files with 29 additions and 21 deletions

7
likely.h Normal file
View file

@ -0,0 +1,7 @@
#ifdef __GNUC__
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else
#define likely(x) (x)
#define unlikely(x) (x)
#endif