diff options
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/logging.cc | 2 | ||||
-rw-r--r-- | runtime/base/logging.h | 3 | ||||
-rw-r--r-- | runtime/base/mutex.h | 6 |
3 files changed, 5 insertions, 6 deletions
diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc index 83ecca8..7d54baf 100644 --- a/runtime/base/logging.cc +++ b/runtime/base/logging.cc @@ -156,8 +156,6 @@ LogMessage::~LogMessage() { if (data_->severity == FATAL) { Runtime::Abort(); } - - delete data_; } HexDump::HexDump(const void* address, size_t byte_count, bool show_actual_addresses) diff --git a/runtime/base/logging.h b/runtime/base/logging.h index d641ae4..eafa050 100644 --- a/runtime/base/logging.h +++ b/runtime/base/logging.h @@ -24,6 +24,7 @@ #include <signal.h> #include "base/macros.h" #include "log_severity.h" +#include "UniquePtr.h" #define CHECK(x) \ if (UNLIKELY(!(x))) \ @@ -194,7 +195,7 @@ class LogMessage { private: static void LogLine(const LogMessageData& data, const char*); - LogMessageData* const data_; + const UniquePtr<LogMessageData> data_; friend void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void* raw_context); friend class Mutex; diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h index b924798..21ba0d2 100644 --- a/runtime/base/mutex.h +++ b/runtime/base/mutex.h @@ -238,7 +238,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread has exclusive access to the ReaderWriterMutex. void AssertExclusiveHeld(const Thread* self) { - if (kDebugLocking & (gAborting == 0)) { + if (kDebugLocking && (gAborting == 0)) { CHECK(IsExclusiveHeld(self)) << *this; } } @@ -246,7 +246,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread doesn't have exclusive access to the ReaderWriterMutex. void AssertNotExclusiveHeld(const Thread* self) { - if (kDebugLocking & (gAborting == 0)) { + if (kDebugLocking && (gAborting == 0)) { CHECK(!IsExclusiveHeld(self)) << *this; } } @@ -257,7 +257,7 @@ class LOCKABLE ReaderWriterMutex : public BaseMutex { // Assert the current thread has shared access to the ReaderWriterMutex. void AssertSharedHeld(const Thread* self) { - if (kDebugLocking & (gAborting == 0)) { + if (kDebugLocking && (gAborting == 0)) { // TODO: we can only assert this well when self != NULL. CHECK(IsSharedHeld(self) || self == NULL) << *this; } |