mirror of https://gerrit.osmocom.org/libosmocore
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
This commit is contained in:
parent
85c7831b65
commit
c797e25f3e
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue