add {un,}likely macros
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
parent
ea646e7077
commit
848a0b1987
|
@ -26,6 +26,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
/** A list of possible position, not sex related */
|
||||
typedef enum
|
||||
|
@ -91,6 +92,9 @@ typedef struct
|
|||
*__ptr = NULL; \
|
||||
} while(0)
|
||||
|
||||
#define likely(expr) __builtin_expect(!!(expr), 1)
|
||||
#define unlikely(expr) __builtin_expect((expr), 0)
|
||||
|
||||
#else
|
||||
|
||||
#define p_delete(mem_p) \
|
||||
|
@ -100,6 +104,9 @@ typedef struct
|
|||
*(void **)__ptr = NULL; \
|
||||
} while (0)
|
||||
|
||||
#define likely(expr) expr
|
||||
#define unlikely(expr) expr
|
||||
|
||||
#endif
|
||||
|
||||
static inline void * __attribute__ ((malloc)) xmalloc(ssize_t size)
|
||||
|
|
Loading…
Reference in New Issue