aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2022-02-08 12:37:03 +0600
committerfixeria <vyanitskiy@sysmocom.de>2022-02-09 10:05:25 +0000
commitc797e25f3ecd362ff8f7104ea8e46e6142f547a7 (patch)
treeb14f4d03796d58136d6d9d0c5eedee4569907023
parent85c7831b658da760f92b40f425304c9cc0e97fe8 (diff)
core/utils.h: make use of OSMO_LIKELY in OSMO_ASSERT
Theoretically, this should improve performance of the code where we frequently invoke OSMO_ASSERT(), like osmo-msc and osmo-bsc. Change-Id: I29b32a2477ec92762f8f0ce5e5c5a30810f6abbe
-rw-r--r--include/osmocom/core/utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 182da08d..ba2cafbe 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -112,7 +112,7 @@ do { \
*/
#define OSMO_ASSERT(exp) \
do { \
- if (!(exp)) { \
+ if (OSMO_UNLIKELY(!(exp))) { \
osmo_panic("Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
} \
} while (0); /* some code invokes OSMO_ASSERT() without the semicolon */