diff options
author | swarmer <swarmer@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
commit | 317da38588b7898a99fd9168571408123350012b (patch) | |
tree | 25eebc31526019ad39a6c1b13f492963d97ba439 /util/system/yassert.cpp | |
parent | 3b2241461d41d41ba1a706b0750c4f0f55c344f6 (diff) | |
download | ydb-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.cpp | 38 |
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(); } } |