[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
likely, unlikely and builtin_expect()
I understand the meaning of likely() and unlikely() in linux/compiler.h,
but I don't undertand the meaning of !! in the definition.
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
why not this?:
#define likely(x) __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)
thanks...
--
Diego Woitasen <diego@xxxxxxxxxxxxxxx>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/