chore: avoid stack overflow in debug tests (#6103)
This commit is contained in:
parent
24f305c0e3
commit
405593ea28
1 changed files with 8 additions and 0 deletions
|
|
@ -37,7 +37,15 @@ extern "C" {
|
|||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define LEAN_UNLIKELY(x) (__builtin_expect((x), 0))
|
||||
#define LEAN_LIKELY(x) (__builtin_expect((x), 1))
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define LEAN_ALWAYS_INLINE __attribute__((always_inline))
|
||||
#else
|
||||
// We have observed stack frame increases from forced inlining overflowing the stack in debug builds,
|
||||
// let's leave the decision to the compiler in that case
|
||||
#define LEAN_ALWAYS_INLINE
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define LEAN_UNLIKELY(x) (x)
|
||||
#define LEAN_LIKELY(x) (x)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue