summaryrefslogtreecommitdiff
path: root/src/mongo/util/assert_util.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-04-29 19:03:08 -0400
committerMathias Stearn <mathias@10gen.com>2016-05-09 17:52:12 -0400
commitfb439046f73ce10b862750df853746c41e9e2e81 (patch)
tree57f253aede294d574f0d7400460d643b7fe97ad5 /src/mongo/util/assert_util.h
parent47e3245fa23e778376a4a3492ebaba471a29417f (diff)
downloadmongo-fb439046f73ce10b862750df853746c41e9e2e81.tar.gz
SERVER-24082 Hint the compiler that error functions are cold
Diffstat (limited to 'src/mongo/util/assert_util.h')
-rw-r--r--src/mongo/util/assert_util.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h
index 32a0946c6e0..82369810174 100644
--- a/src/mongo/util/assert_util.h
+++ b/src/mongo/util/assert_util.h
@@ -236,12 +236,12 @@ inline void fassertNoTrace(int msgid, const Status& status) {
* MONGO_COMPILER_UNREACHABLE as it is impossible to mark a lambda noreturn.
*/
#define uassert MONGO_uassert
-#define MONGO_uassert(msgid, msg, expr) \
- do { \
- if (MONGO_unlikely(!(expr))) { \
- [&]() { ::mongo::uasserted(msgid, msg); }(); \
- MONGO_COMPILER_UNREACHABLE; \
- } \
+#define MONGO_uassert(msgid, msg, expr) \
+ do { \
+ if (MONGO_unlikely(!(expr))) { \
+ [&]() MONGO_COMPILER_COLD_FUNCTION { ::mongo::uasserted(msgid, msg); }(); \
+ MONGO_COMPILER_UNREACHABLE; \
+ } \
} while (false)
inline void uassertStatusOK(const Status& status) {
@@ -285,12 +285,12 @@ inline void fassertStatusOK(int msgid, const Status& s) {
display happening.
*/
#define massert MONGO_massert
-#define MONGO_massert(msgid, msg, expr) \
- do { \
- if (MONGO_unlikely(!(expr))) { \
- [&] { ::mongo::msgasserted(msgid, msg); }(); \
- MONGO_COMPILER_UNREACHABLE; \
- } \
+#define MONGO_massert(msgid, msg, expr) \
+ do { \
+ if (MONGO_unlikely(!(expr))) { \
+ [&]() MONGO_COMPILER_COLD_FUNCTION { ::mongo::msgasserted(msgid, msg); }(); \
+ MONGO_COMPILER_UNREACHABLE; \
+ } \
} while (false)
inline void massertStatusOK(const Status& status) {
@@ -301,7 +301,7 @@ inline void massertStatusOK(const Status& status) {
inline void massertNoTraceStatusOK(const Status& status) {
if (MONGO_unlikely(!status.isOK())) {
- [&] {
+ [&]() MONGO_COMPILER_COLD_FUNCTION {
msgassertedNoTrace((status.location() != 0 ? status.location() : status.code()),
status.reason());
}();