mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: add expect_with_probability()
macro.
This commit is contained in:
parent
8404cc1fd7
commit
c0f8ecd6f2
10
src/base.h
10
src/base.h
@ -645,6 +645,16 @@ __extern_C key_t ftok(const char *, int);
|
|||||||
#endif
|
#endif
|
||||||
#endif /* __anonymous_struct_extension__ */
|
#endif /* __anonymous_struct_extension__ */
|
||||||
|
|
||||||
|
#ifndef expect_with_probability
|
||||||
|
#if defined(__builtin_expect_with_probability) || \
|
||||||
|
__has_builtin(__builtin_expect_with_probability) || __GNUC_PREREQ(9, 0)
|
||||||
|
#define expect_with_probability(expr, value, prob) \
|
||||||
|
__builtin_expect_with_probability(expr, value, prob)
|
||||||
|
#else
|
||||||
|
#define expect_with_probability(expr, value, prob) (expr)
|
||||||
|
#endif
|
||||||
|
#endif /* expect_with_probability */
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if defined(MDBX_USE_VALGRIND)
|
#if defined(MDBX_USE_VALGRIND)
|
||||||
|
Loading…
Reference in New Issue
Block a user