summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorroot <[email protected]>2023-12-21 02:40:50 +0000
committerroot <[email protected]>2023-12-21 02:40:50 +0000
commitff98a9063d2070b11e7c6f6cfbe1abeb59c4e6cd (patch)
treed5f457308d28a5dba54aafd4229cb27439e6e582 /common
parent4f76c20b6c303b1e3dd7a9514c94f2db554ad88c (diff)
performance optimize
Diffstat (limited to 'common')
-rw-r--r--common/include/utils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/include/utils.h b/common/include/utils.h
index c03b291..8067749 100644
--- a/common/include/utils.h
+++ b/common/include/utils.h
@@ -14,6 +14,10 @@ extern "C"
(type *)( (char *)__mptr - offsetof(type,member) );})
#endif
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+#define prefetch(x) __builtin_prefetch(x)
+
#define LOG_TAG_SHAPING "SHAPING"
#define LOG_TAG_SWARMKV "SWARMKV"
#define LOG_TAG_STAT "STAT"