mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-05 04:56:10 +02:00
MINOR: compiler: restore the likely() wrapper for gcc 5.x
After some tests, gcc 5.x produces better code with likely() than without, contrary to gcc 4.x where it was better to disable it. Let's re-enable it for 5 and above.
This commit is contained in:
parent
636e6afcfa
commit
c939835f77
@ -89,8 +89,8 @@
|
||||
#define __builtin_expect(x,y) (x)
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (x)
|
||||
#elif __GNUC__ < 4
|
||||
/* gcc 3.x does the best job at this */
|
||||
#elif __GNUC__ < 4 || __GNUC__ >= 5
|
||||
/* gcc 3.x and 5.x do the best job at this */
|
||||
#define likely(x) (__builtin_expect((x) != 0, 1))
|
||||
#define unlikely(x) (__builtin_expect((x) != 0, 0))
|
||||
#else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user