Bug 1225365 - Fix assertion in the nsScriptNameSpaceManager memory reporter. r=bz.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 17 Nov 2015 14:46:46 -0800
changeset 273072 86a46ffd473a4597230a1f638a6fa798ec81fdaa
parent 273071 42585d719cc7d5c15d063bd01bb38e003d82214a
child 273073 eb70b5be4f9171923753d3ac6929af42edd1f9e8
push id29693
push usercbook@mozilla.com
push dateWed, 18 Nov 2015 13:50:33 +0000
treeherdermozilla-central@1d6155d7e6c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1225365
milestone45.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 1225365 - Fix assertion in the nsScriptNameSpaceManager memory reporter. r=bz. Also, use a fatal assertion in nsStringBuffer::SizeOfIncludingThisMustBeUnshared().
dom/base/nsScriptNameSpaceManager.h
xpcom/string/nsSubstring.cpp
--- a/dom/base/nsScriptNameSpaceManager.h
+++ b/dom/base/nsScriptNameSpaceManager.h
@@ -86,17 +86,17 @@ public:
   // Our hash table ops don't care about the order of these members.
   nsString mKey;
   nsGlobalNameStruct mGlobalName;
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
     // Measurement of the following members may be added later if DMD finds it
     // is worthwhile:
     // - mGlobalName
-    return mKey.SizeOfExcludingThisMustBeUnshared(aMallocSizeOf);
+    return mKey.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
   }
 };
 
 class nsICategoryManager;
 
 class nsScriptNameSpaceManager : public nsIObserver,
                                  public nsSupportsWeakReference,
                                  public nsIMemoryReporter
--- a/xpcom/string/nsSubstring.cpp
+++ b/xpcom/string/nsSubstring.cpp
@@ -314,18 +314,18 @@ nsStringBuffer::ToString(uint32_t aLen, 
     AddRef();
   }
   accessor->set(data, aLen, flags);
 }
 
 size_t
 nsStringBuffer::SizeOfIncludingThisMustBeUnshared(mozilla::MallocSizeOf aMallocSizeOf) const
 {
-  NS_ASSERTION(!IsReadonly(),
-               "shared StringBuffer in SizeOfIncludingThisMustBeUnshared");
+  MOZ_ASSERT(!IsReadonly(),
+             "shared StringBuffer in SizeOfIncludingThisMustBeUnshared");
   return aMallocSizeOf(this);
 }
 
 size_t
 nsStringBuffer::SizeOfIncludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   if (!IsReadonly()) {
     return SizeOfIncludingThisMustBeUnshared(aMallocSizeOf);