mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 08:25:51 +00:00
Beast clean up:
* Remove binding, dispatch handling and exit hooks in favor of std alternatives; remove crash-handling infrastructure, error message framework, system-specific process handling and Objective-C interop helpers. * Simplify Beast function profiling * Simplify beast::Time interface * Simplify beast::String interface * Simplify beast::File interface
This commit is contained in:
@@ -42,18 +42,9 @@ static_assert (sizeof (std::uint64_t) == 8, "std::uint64_t must be exactly 8 byt
|
||||
|
||||
namespace beast
|
||||
{
|
||||
|
||||
std::string
|
||||
SystemStats::getBeastVersion()
|
||||
{
|
||||
return "Beast v" + std::to_string (BEAST_MAJOR_VERSION) +
|
||||
"." + std::to_string (BEAST_MINOR_VERSION) +
|
||||
"." + std::to_string (BEAST_BUILDNUMBER);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
std::vector <std::string>
|
||||
SystemStats::getStackBacktrace()
|
||||
getStackBacktrace()
|
||||
{
|
||||
std::vector <std::string> result;
|
||||
|
||||
@@ -121,41 +112,4 @@ SystemStats::getStackBacktrace()
|
||||
return result;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
static SystemStats::CrashHandlerFunction globalCrashHandler = nullptr;
|
||||
|
||||
#if BEAST_WINDOWS
|
||||
static LONG WINAPI handleCrash (LPEXCEPTION_POINTERS)
|
||||
{
|
||||
globalCrashHandler();
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
#else
|
||||
static void handleCrash (int)
|
||||
{
|
||||
globalCrashHandler();
|
||||
kill (getpid(), SIGKILL);
|
||||
}
|
||||
|
||||
int beast_siginterrupt (int sig, int flag);
|
||||
#endif
|
||||
|
||||
void SystemStats::setApplicationCrashHandler (CrashHandlerFunction handler)
|
||||
{
|
||||
bassert (handler != nullptr); // This must be a valid function.
|
||||
globalCrashHandler = handler;
|
||||
|
||||
#if BEAST_WINDOWS
|
||||
SetUnhandledExceptionFilter (handleCrash);
|
||||
#else
|
||||
const int signals[] = { SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGABRT, SIGSYS };
|
||||
|
||||
for (int i = 0; i < numElementsInArray (signals); ++i)
|
||||
{
|
||||
::signal (signals[i], handleCrash);
|
||||
beast_siginterrupt (signals[i], 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // beast
|
||||
|
||||
Reference in New Issue
Block a user