add likely / unlikely macros
This commit is contained in:
parent
61beeb9f69
commit
6b5609d23b
@ -27,6 +27,14 @@
|
|||||||
# define JEMALLOC_CC_SILENCE_INIT(v)
|
# define JEMALLOC_CC_SILENCE_INIT(v)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define a custom assert() in order to reduce the chances of deadlock during
|
* Define a custom assert() in order to reduce the chances of deadlock during
|
||||||
* assertion failure.
|
* assertion failure.
|
||||||
|
Loading…
Reference in New Issue
Block a user