summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gediminas Jakutis <gediminas@varciai.lt> 2021-02-21 17:16:04 +0200
committerGravatar Gediminas Jakutis <gediminas@varciai.lt> 2021-02-21 17:16:04 +0200
commitf110dbc40259c9367469eca6d1ae31842c72f02a (patch)
treee055b98b3785c53908847b27227ce69755971d3f
parent29712a5098842ea3930ec00ddd1c0b9d264ba9b5 (diff)
downloadalgos-ld1-f110dbc40259c9367469eca6d1ae31842c72f02a.tar.gz
algos-ld1-f110dbc40259c9367469eca6d1ae31842c72f02a.tar.bz2
algos-ld1-f110dbc40259c9367469eca6d1ae31842c72f02a.zip
employ the unlikely macro on diagnostics.
This improves performance by about ~2%, testing shows. Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
-rw-r--r--src/defs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/defs.h b/src/defs.h
index 425e97c..e90f0e5 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -9,14 +9,15 @@
#include <stdint.h>
#include <sys/types.h>
#include <rin/diagnostic.h>
+#include <rin/definitions.h>
#define try_s(a,l) do {\
- if(a) {\
+ if(unlikely(a)) {\
goto l;\
}} while (0);
#define try(a,l,e,m,...) do {\
- if(a) {\
+ if(unlikely(a)) {\
ret = e;\
rin_err(m __VA_OPT__(,) __VA_ARGS__);\
goto l;\