projects
/
apps
/
pfixtools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
532da48
)
Add likely/unlikely macros.
author
Pierre Habouzit
<madcoder@debian.org>
Mon, 6 Oct 2008 09:38:59 +0000
(11:38 +0200)
committer
Pierre Habouzit
<madcoder@debian.org>
Mon, 6 Oct 2008 09:38:59 +0000
(11:38 +0200)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
common/common.h
patch
|
blob
|
history
diff --git
a/common/common.h
b/common/common.h
index
30ce1d8
..
896eacc
100644
(file)
--- a/
common/common.h
+++ b/
common/common.h
@@
-70,6
+70,9
@@
typedef void (*exitcall_t)(void);
#define module_init(fn) static __init initcall_t __init_##fn = fn;
#define module_exit(fn) static __exit exitcall_t __exit_##fn = fn;
+#define likely(expr) __builtin_expect((expr) != 0, 1)
+#define unlikely(expr) __builtin_expect((expr) != 0, 0)
+
#define __log(Level, Fmt, ...) \
if (log_level >= Level) { \
if (log_syslog) { \