Bug 1121760 (part 5) - Remove PL_DHashMarkTableImmutable(). r=poiru.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 14 Sep 2015 14:23:27 -0700
changeset 295310 50772808876106e59a15b8300eeb311a3a3b10d7
parent 295309 f957524fc6248406f1029dac87869ea3e77fd75d
child 295311 36f11da8d2d9a649a0fafb4ce85ee41b552239ff
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspoiru
bugs1121760
milestone43.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 1121760 (part 5) - Remove PL_DHashMarkTableImmutable(). r=poiru.
parser/htmlparser/nsHTMLEntities.cpp
xpcom/ds/nsStaticNameTable.cpp
xpcom/glue/nsTHashtable.h
xpcom/glue/pldhash.cpp
xpcom/glue/pldhash.h
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -104,18 +104,18 @@ nsHTMLEntities::AddRefTable(void)
                          (gUnicodeToEntity->Add(NS_INT32_TO_PTR(node->mUnicode),
                                                 fallible));
       NS_ASSERTION(entry, "Error adding an entry");
       // Prefer earlier entries when we have duplication.
       if (!entry->node)
         entry->node = node;
     }
 #ifdef DEBUG
-    PL_DHashMarkTableImmutable(gUnicodeToEntity);
-    PL_DHashMarkTableImmutable(gEntityToUnicode);
+    gUnicodeToEntity->MarkImmutable();
+    gEntityToUnicode->MarkImmutable();
 #endif
   }
   ++gTableRefCnt;
   return NS_OK;
 }
 
 void
 nsHTMLEntities::ReleaseTable(void)
--- a/xpcom/ds/nsStaticNameTable.cpp
+++ b/xpcom/ds/nsStaticNameTable.cpp
@@ -142,17 +142,17 @@ nsStaticCaseInsensitiveNameTable::nsStat
     }
 
     NS_ASSERTION(entry->mString == 0, "Entry already exists!");
 
     entry->mString = strPtr;      // not owned!
     entry->mIndex = index;
   }
 #ifdef DEBUG
-  PL_DHashMarkTableImmutable(&mNameTable);
+  mNameTable.MarkImmutable();
 #endif
 }
 
 nsStaticCaseInsensitiveNameTable::~nsStaticCaseInsensitiveNameTable()
 {
   // manually call the destructor on placement-new'ed objects
   for (uint32_t index = 0; index < mNameTable.EntryCount(); index++) {
     mNameArray[index].~nsDependentCString();
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -277,17 +277,17 @@ public:
   /**
    * Mark the table as constant after initialization.
    *
    * This will prevent assertions when a read-only hash is accessed on multiple
    * threads without synchronization.
    */
   void MarkImmutable()
   {
-    PL_DHashMarkTableImmutable(&mTable);
+    mTable.MarkImmutable();
   }
 #endif
 
 protected:
   PLDHashTable mTable;
 
   static const void* s_GetKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -848,21 +848,15 @@ void
 PLDHashTable::Iterator::Remove()
 {
   // This cast is needed for the same reason as the one in the destructor.
   mTable->RawRemove(Get());
   mHaveRemoved = true;
 }
 
 #ifdef DEBUG
-MOZ_ALWAYS_INLINE void
+void
 PLDHashTable::MarkImmutable()
 {
   mChecker.SetNonWritable();
 }
-
-void
-PL_DHashMarkTableImmutable(PLDHashTable* aTable)
-{
-  aTable->MarkImmutable();
-}
 #endif
 
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -615,14 +615,9 @@ void
 PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
 // If you use PLDHashEntryStub or a subclass of it as your entry struct, and
 // if your entries move via memcpy and clear via memset(0), you can use these
 // stub operations.
 const PLDHashTableOps*
 PL_DHashGetStubOps(void);
 
-#ifdef DEBUG
-void
-PL_DHashMarkTableImmutable(PLDHashTable* aTable);
-#endif
-
 #endif /* pldhash_h___ */