From b6798a513029c88781d889d30017d9c069be117c Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Mon, 5 Feb 2024 22:31:58 -0500 Subject: [PATCH] amputate unused kCrashWithStats --- src/internal_logging.cc | 20 -------------------- src/internal_logging.h | 1 - src/tcmalloc.cc | 1 - 3 files changed, 22 deletions(-) diff --git a/src/internal_logging.cc b/src/internal_logging.cc index 95ecdf6..f3368a9 100644 --- a/src/internal_logging.cc +++ b/src/internal_logging.cc @@ -45,13 +45,6 @@ #include "base/logging.h" #include "base/spinlock.h" // for SpinLockHolder, SpinLock -// Variables for storing crash output. Allocated statically since we -// may not be able to heap-allocate while crashing. -static SpinLock crash_lock; -static bool crashed = false; -static const int kStatsBufferSize = 16 << 10; -static char stats_buffer[kStatsBufferSize] = { 0 }; - namespace tcmalloc { static void WriteMessage(const char* msg, int length) { @@ -100,20 +93,7 @@ void Log(LogMode mode, const char* filename, int line, return; } - bool first_crash = false; - { - SpinLockHolder l(&crash_lock); - if (!crashed) { - crashed = true; - first_crash = true; - } - } - (*log_message_writer)(state.buf_, msglen); - if (first_crash && mode == kCrashWithStats) { - MallocExtension::instance()->GetStats(stats_buffer, kStatsBufferSize); - (*log_message_writer)(stats_buffer, strlen(stats_buffer)); - } abort(); } diff --git a/src/internal_logging.h b/src/internal_logging.h index e864e45..661c9e5 100644 --- a/src/internal_logging.h +++ b/src/internal_logging.h @@ -55,7 +55,6 @@ namespace tcmalloc { enum LogMode { kLog, // Just print the message kCrash, // Print the message and crash - kCrashWithStats // Print the message, some stats, and crash }; class Logger; diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index 6da3d06..4c34040 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -146,7 +146,6 @@ using std::vector; using tcmalloc::kLog; using tcmalloc::kCrash; -using tcmalloc::kCrashWithStats; using tcmalloc::Log; using tcmalloc::PageHeap; using tcmalloc::PageHeapAllocator;