summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@well-typed.com>2020-11-23 17:54:46 -0500
committerBen Gamari <ben@well-typed.com>2020-11-23 17:54:46 -0500
commitfb4382460df5c75e3252eb9b462bf537b481e651 (patch)
tree3ca1417790a9976ef717379d8b5d4e5b14391c5f
parent6815603f271484766425ff2e37043b78da2d073c (diff)
downloadhaskell-wip/check-likelihood.tar.gz
rts: Use RTS_LIKELY in CHECKwip/check-likelihood
Most compilers probably already infer that `barf` diverges but it nevertheless doesn't hurt to be explicit.
-rw-r--r--includes/Rts.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index 1e5a60262b..38d2c11642 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -114,13 +114,13 @@ void _assertFail(const char *filename, unsigned int linenum)
GNUC3_ATTRIBUTE(__noreturn__);
#define CHECK(predicate) \
- if (predicate) \
+ if (RTS_LIKELY(predicate)) \
/*null*/; \
else \
_assertFail(__FILE__, __LINE__)
#define CHECKM(predicate, msg, ...) \
- if (predicate) \
+ if (RTS_LIKELY(predicate)) \
/*null*/; \
else \
barf(msg, ##__VA_ARGS__)