Bug 1275755 - Remove MOZ_DUMP_ATOM_LEAKS. r=froydnj
authorBobby Holley <bobbyholley@gmail.com>
Wed, 25 May 2016 18:41:34 -0700
changeset 299426 5bab999902fc0147cd24d3f5e1d7465f8ccd498e
parent 299425 5eaeae69698423d1d2d59dbc2c3d15d54d2fd26d
child 299427 2ec4d49ae88dbaf20b1d8f2e119695ede301957c
push id77565
push userbholley@mozilla.com
push dateSat, 28 May 2016 16:08:22 +0000
treeherdermozilla-inbound@de635a6b22cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1275755
milestone49.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 1275755 - Remove MOZ_DUMP_ATOM_LEAKS. r=froydnj I don't think anyone is using this anymore. It would be good to assert that there are no leaks, but that doesn't pass for me in a local build, and I don't have time to chase it.
xpcom/ds/nsAtomTable.cpp
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -468,36 +468,19 @@ static bool gStaticAtomTableSealed = fal
 
 void
 NS_PurgeAtomTable()
 {
   delete gStaticAtomTable;
   gStaticAtomTable = nullptr;
 
   if (gAtomTable) {
-#ifdef DEBUG
-    const char* dumpAtomLeaks = PR_GetEnv("MOZ_DUMP_ATOM_LEAKS");
-    if (dumpAtomLeaks && *dumpAtomLeaks) {
-      uint32_t leaked = 0;
-      printf("*** %d atoms still exist (including static):\n",
-             gAtomTable->EntryCount());
-      for (auto iter = gAtomTable->Iter(); !iter.Done(); iter.Next()) {
-        auto entry = static_cast<AtomTableEntry*>(iter.Get());
-        nsIAtom* atom = entry->mAtom;
-        if (!atom->IsStaticAtom()) {
-          leaked++;
-          nsAutoCString str;
-          atom->ToUTF8String(str);
-          fputs(str.get(), stdout);
-          fputs("\n", stdout);
-        }
-      }
-      printf("*** %u dynamic atoms leaked\n", leaked);
-    }
-#endif
+    // XXXbholley: it would be good to assert gAtomTable->EntryCount() == 0
+    // here, but that currently fails. Probably just a few things that need
+    // to be fixed up.
     delete gAtomTable;
     gAtomTable = nullptr;
   }
 }
 
 void
 NS_SizeOfAtomTablesIncludingThis(MallocSizeOf aMallocSizeOf,
                                  size_t* aMain, size_t* aStatic)