Export of internal Abseil changes.

--
36d990031b4ae8e2debaccca63ff41829383a7d2 by Derek Mauro <dmauro@google.com>:

Rename FailureSignalHandler to AbslFailureSignalHandler so that we
don't confuse poor souls.

PiperOrigin-RevId: 207539530

--
0ced19ef8e0e0887f9809ffb88c5ef5f8746a6aa by Abseil Team <absl-team@google.com>:

Minor changes to support WebAssembly.

PiperOrigin-RevId: 207286743
GitOrigin-RevId: 36d990031b4ae8e2debaccca63ff41829383a7d2
Change-Id: I6b86713e96f5c32b595171594e456e38c898e601
This commit is contained in:
Abseil Team 2018-08-06 07:07:10 -07:00 committed by Derek Mauro
parent 8f96be6ca6
commit bea85b5273
4 changed files with 13 additions and 13 deletions

View file

@ -35,7 +35,7 @@
EXPECT_DEATH(expr, ".*")
#else
#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \
EXPECT_DEATH(expr, text)
EXPECT_DEATH_IF_SUPPORTED(expr, text)
#endif

View file

@ -252,7 +252,7 @@ ABSL_ATTRIBUTE_NOINLINE static void WriteStackTrace(
depth, min_dropped_frames, symbolize_stacktrace, writerfn, writerfn_arg);
}
// Called by FailureSignalHandler() to write the failure info. It is
// Called by AbslFailureSignalHandler() to write the failure info. It is
// called once with writerfn set to WriteToStderr() and then possibly
// with writerfn set to the user provided function.
static void WriteFailureInfo(int signo, void* ucontext,
@ -278,9 +278,9 @@ static void PortableSleepForSeconds(int seconds) {
}
#ifdef ABSL_HAVE_ALARM
// FailureSignalHandler() installs this as a signal handler for
// AbslFailureSignalHandler() installs this as a signal handler for
// SIGALRM, then sets an alarm to be delivered to the program after a
// set amount of time. If FailureSignalHandler() hangs for more than
// set amount of time. If AbslFailureSignalHandler() hangs for more than
// the alarm timeout, ImmediateAbortSignalHandler() will abort the
// program.
static void ImmediateAbortSignalHandler(int) {
@ -294,11 +294,10 @@ using GetTidType = decltype(absl::base_internal::GetTID());
ABSL_CONST_INIT static std::atomic<GetTidType> failed_tid(0);
#ifndef ABSL_HAVE_SIGACTION
static void FailureSignalHandler(int signo) {
static void AbslFailureSignalHandler(int signo) {
void* ucontext = nullptr;
#else
static void FailureSignalHandler(int signo, siginfo_t*,
void* ucontext) {
static void AbslFailureSignalHandler(int signo, siginfo_t*, void* ucontext) {
#endif
const GetTidType this_tid = absl::base_internal::GetTID();
@ -308,10 +307,10 @@ static void FailureSignalHandler(int signo, siginfo_t*,
std::memory_order_acq_rel, std::memory_order_relaxed)) {
ABSL_RAW_LOG(
ERROR,
"Signal %d raised at PC=%p while already in FailureSignalHandler()",
"Signal %d raised at PC=%p while already in AbslFailureSignalHandler()",
signo, absl::debugging_internal::GetProgramCounter(ucontext));
if (this_tid != previous_failed_tid) {
// Another thread is already in FailureSignalHandler(), so wait
// Another thread is already in AbslFailureSignalHandler(), so wait
// a bit for it to finish. If the other thread doesn't kill us,
// we do so after sleeping.
PortableSleepForSeconds(3);
@ -349,7 +348,7 @@ static void FailureSignalHandler(int signo, siginfo_t*,
void InstallFailureSignalHandler(const FailureSignalHandlerOptions& options) {
fsh_options = options;
for (auto& it : failure_signal_data) {
InstallOneFailureHandler(&it, FailureSignalHandler);
InstallOneFailureHandler(&it, AbslFailureSignalHandler);
}
}

View file

@ -711,8 +711,9 @@ TEST(stringtest, safe_strtou64_base_length_delimited) {
}
}
// feenableexcept() and fedisableexcept() are missing on Mac OS X, MSVC.
#if defined(_MSC_VER) || defined(__APPLE__)
// feenableexcept() and fedisableexcept() are missing on Mac OS X, MSVC,
// and WebAssembly.
#if defined(_MSC_VER) || defined(__APPLE__) || defined(__EMSCRIPTEN__)
#define ABSL_MISSING_FEENABLEEXCEPT 1
#define ABSL_MISSING_FEDISABLEEXCEPT 1
#endif

View file

@ -288,7 +288,7 @@ TEST(IntSpan, Subspan) {
#ifdef ABSL_HAVE_EXCEPTIONS
EXPECT_THROW(absl::MakeSpan(ramp).subspan(11, 5), std::out_of_range);
#else
EXPECT_DEATH(absl::MakeSpan(ramp).subspan(11, 5), "");
EXPECT_DEATH_IF_SUPPORTED(absl::MakeSpan(ramp).subspan(11, 5), "");
#endif
}