Bug 1529955 - remove corruption canary from LogModule; r=erahm
authorNathan Froyd <froydnj@mozilla.com>
Wed, 27 Feb 2019 14:28:10 -0500
changeset 519526 739c3b30b230fe1df1b3b94ae9b6a7df9467f31a
parent 519525 8cd8d6fd4931766ac24ca6248b78520607acd7ed
child 519527 603a46a1e921a1fae58fa168461935a42270c1f0
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1529955
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529955 - remove corruption canary from LogModule; r=erahm This canary isn't catching anything interesting, so we might as well save a little bit of overhead by removing it.
xpcom/base/Logging.cpp
xpcom/base/Logging.h
--- a/xpcom/base/Logging.cpp
+++ b/xpcom/base/Logging.cpp
@@ -54,18 +54,16 @@ LazyLogModule::operator LogModule*() {
   //     than once, but that's okay as it will be set to the same LogModule
   //     instance each time. Also note LogModule::Get is thread-safe.
   LogModule* tmp = mLog;
   if (MOZ_UNLIKELY(!tmp)) {
     tmp = LogModule::Get(mLogName);
     mLog = tmp;
   }
 
-  mCanary.Check();
-
   return tmp;
 }
 
 namespace detail {
 
 void log_print(const LogModule* aModule, LogLevel aLevel, const char* aFmt,
                ...) {
   va_list ap;
--- a/xpcom/base/Logging.h
+++ b/xpcom/base/Logging.h
@@ -9,17 +9,16 @@
 
 #include <string.h>
 #include <stdarg.h>
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Likely.h"
-#include "mozilla/Poison.h"
 
 // We normally have logging enabled everywhere, but measurements showed that
 // having logging enabled on Android is quite expensive (hundreds of kilobytes
 // for both the format strings for logging and the code to perform all the
 // logging calls).  Because retrieving logs from a mobile device is
 // comparatively more difficult for Android than it is for desktop and because
 // desktop machines tend to be less space/bandwidth-constrained than Android
 // devices, we've chosen to leave logging enabled on desktop, but disabled on
@@ -168,17 +167,16 @@ class LazyLogModule final {
  public:
   explicit constexpr LazyLogModule(const char* aLogName)
       : mLogName(aLogName), mLog(nullptr) {}
 
   operator LogModule*();
 
  private:
   const char* const mLogName;
-  const CorruptionCanaryForStatics mCanary;
 
   // As for LogModule::mLevel, don't preserve behavior for this atomic when
   // recording/replaying.
   Atomic<LogModule*, ReleaseAcquire, recordreplay::Behavior::DontPreserve> mLog;
 };
 
 namespace detail {