aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/yassert.cpp
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.ru>2022-02-10 16:46:31 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:31 +0300
commit317da38588b7898a99fd9168571408123350012b (patch)
tree25eebc31526019ad39a6c1b13f492963d97ba439 /util/system/yassert.cpp
parent3b2241461d41d41ba1a706b0750c4f0f55c344f6 (diff)
downloadydb-317da38588b7898a99fd9168571408123350012b.tar.gz
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/yassert.cpp')
-rw-r--r--util/system/yassert.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/util/system/yassert.cpp b/util/system/yassert.cpp
index 0f586648b78..60dbe4c04a1 100644
--- a/util/system/yassert.cpp
+++ b/util/system/yassert.cpp
@@ -7,7 +7,7 @@
#include <util/datetime/base.h>
#include <util/generic/singleton.h>
-#include <util/generic/strbuf.h>
+#include <util/generic/strbuf.h>
#include <util/generic/string.h>
#include <util/stream/output.h>
#include <util/stream/str.h>
@@ -34,9 +34,9 @@ namespace {
struct TPanicLockHolder: public TAdaptiveLock {
};
}
-namespace NPrivate {
- [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept;
-}
+namespace NPrivate {
+ [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept;
+}
void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, const char* expr, const char* format, ...) noexcept {
try {
@@ -51,18 +51,18 @@ void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, c
vsprintf(errorMsg, format[0] == ' ' ? format + 1 : format, args);
va_end(args);
- constexpr int abiPlaceholder = 0;
- ::NPrivate::InternalPanicImpl(line, function, expr, abiPlaceholder, abiPlaceholder, abiPlaceholder, file.As<TStringBuf>(), errorMsg.c_str(), errorMsg.size());
- } catch (...) {
- // ¯\_(ツ)_/¯
- }
-
- abort();
-}
-
-namespace NPrivate {
- [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept try {
- TStringBuf errorMsg{errorMessage, errorMessageSize};
+ constexpr int abiPlaceholder = 0;
+ ::NPrivate::InternalPanicImpl(line, function, expr, abiPlaceholder, abiPlaceholder, abiPlaceholder, file.As<TStringBuf>(), errorMsg.c_str(), errorMsg.size());
+ } catch (...) {
+ // ¯\_(ツ)_/¯
+ }
+
+ abort();
+}
+
+namespace NPrivate {
+ [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept try {
+ TStringBuf errorMsg{errorMessage, errorMessageSize};
const TString now = TInstant::Now().ToStringLocal();
TString r;
@@ -72,7 +72,7 @@ namespace NPrivate {
} else {
o << "FAIL (" << now << "): " << errorMsg << Endl;
}
- o << " " << file << ":" << line << Endl;
+ o << " " << file << ":" << line << Endl;
if (expr) {
o << " " << function << "(): requirement " << expr << " failed" << Endl;
} else {
@@ -87,8 +87,8 @@ namespace NPrivate {
Cerr << "Failed to dump clang coverage" << Endl;
}
#endif
- abort();
+ abort();
} catch (...) {
- abort();
+ abort();
}
}