compiler: add likely() and unlikely() support

parent 0eb3b1ce
...@@ -85,4 +85,7 @@ ...@@ -85,4 +85,7 @@
#define __public __attribute__((visibility("default"))) #define __public __attribute__((visibility("default")))
#endif #endif
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif /* __LXC_COMPILER_H */ #endif /* __LXC_COMPILER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment