Bug 1121304 (part 2) - Remove PLDHashTableOps::{alloc,free}Table. r=froydnj.
☠☠ backed out by d561a7fc7b74 ☠ ☠
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 14 Jan 2015 14:35:56 -0800
changeset 223904 20651ac1954971d6ba4758bbc5f373502bdb6e34
parent 223903 758afec77c95285c5cd4256079c6be171b375483
child 223905 ce39fe1d44c506876ba17ca0a58c32d685c1ae68
push id54068
push usernnethercote@mozilla.com
push dateThu, 15 Jan 2015 03:05:15 +0000
treeherdermozilla-inbound@20651ac19549 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1121304
milestone38.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 1121304 (part 2) - Remove PLDHashTableOps::{alloc,free}Table. r=froydnj.
dom/base/nsContentList.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsScriptNameSpaceManager.cpp
dom/xul/XULDocument.cpp
embedding/components/commandhandler/nsCommandParams.cpp
gfx/thebes/gfxFT2FontList.cpp
js/xpconnect/src/XPCMaps.cpp
layout/base/nsFrameManager.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsRuleNode.cpp
layout/tables/SpanningCellSorter.cpp
modules/libpref/prefapi.cpp
netwerk/base/src/nsLoadGroup.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/dns/nsHostResolver.cpp
netwerk/protocol/http/nsHttp.cpp
parser/htmlparser/nsHTMLEntities.cpp
rdf/base/nsRDFService.cpp
security/manager/boot/src/nsSecureBrowserUIImpl.cpp
security/manager/ssl/src/nsCertTree.cpp
security/manager/ssl/src/nsNSSShutDown.cpp
uriloader/base/nsDocLoader.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsPersistentProperties.cpp
xpcom/ds/nsStaticNameTable.cpp
xpcom/glue/nsTHashtable.h
xpcom/glue/pldhash.cpp
xpcom/glue/pldhash.h
xpcom/tests/TestPLDHash.cpp
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -203,18 +203,16 @@ NS_GetContentList(nsINode* aRootNode,
   nsContentList* cachedList = sRecentlyUsedContentLists[recentlyUsedCacheIndex];
   if (cachedList && cachedList->MatchesKey(hashKey)) {
     list = cachedList;
     return list.forget();
   }
 
   static const PLDHashTableOps hash_table_ops =
   {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     ContentListHashtableHashKey,
     ContentListHashtableMatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub
   };
 
   // Initialize the hashtable if needed.
   if (!gContentListHashTable.ops) {
@@ -315,18 +313,16 @@ GetFuncStringContentList(nsINode* aRootN
                          const nsAString& aString)
 {
   NS_ASSERTION(aRootNode, "content list has to have a root");
 
   nsRefPtr<nsCacheableFuncStringContentList> list;
 
   static const PLDHashTableOps hash_table_ops =
   {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     FuncStringContentListHashtableHashKey,
     FuncStringContentListHashtableMatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub
   };
 
   // Initialize the hashtable if needed.
   if (!gFuncStringContentListHashTable.ops) {
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -474,18 +474,16 @@ nsContentUtils::Init()
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!InitializeEventTable())
     return NS_ERROR_FAILURE;
 
   if (!sEventListenerManagersHash.ops) {
     static const PLDHashTableOps hash_table_ops =
     {
-      PL_DHashAllocTable,
-      PL_DHashFreeTable,
       PL_DHashVoidPtrKeyStub,
       PL_DHashMatchEntryStub,
       PL_DHashMoveEntryStub,
       EventListenerManagerHashClearEntry,
       EventListenerManagerHashInitEntry
     };
 
     PL_DHashTableInit(&sEventListenerManagersHash, &hash_table_ops,
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3967,18 +3967,16 @@ nsDocument::SetSubDocumentFor(Element* a
       }
     }
   } else {
     if (!mSubDocuments) {
       // Create a new hashtable
 
       static const PLDHashTableOps hash_table_ops =
       {
-        PL_DHashAllocTable,
-        PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         PL_DHashMatchEntryStub,
         PL_DHashMoveEntryStub,
         SubDocClearEntry,
         SubDocInitEntry
       };
 
       mSubDocuments = PL_NewDHashTable(&hash_table_ops, sizeof(SubDocMapEntry));
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -315,18 +315,16 @@ nsScriptNameSpaceManager::RegisterInterf
 
 #define GLOBALNAME_HASHTABLE_INITIAL_LENGTH   512
 
 nsresult
 nsScriptNameSpaceManager::Init()
 {
   static const PLDHashTableOps hash_table_ops =
   {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     GlobalNameHashHashKey,
     GlobalNameHashMatchEntry,
     PL_DHashMoveEntryStub,
     GlobalNameHashClearEntry,
     GlobalNameHashInitEntry
   };
 
   mIsInitialized = PL_DHashTableInit(&mGlobalNames, &hash_table_ops,
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -755,18 +755,16 @@ XULDocument::AddBroadcastListenerFor(Ele
     rv = nsContentUtils::CheckSameOrigin(this, &aListener);
 
     if (NS_FAILED(rv)) {
         aRv.Throw(rv);
         return;
     }
 
     static const PLDHashTableOps gOps = {
-        PL_DHashAllocTable,
-        PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         PL_DHashMatchEntryStub,
         PL_DHashMoveEntryStub,
         ClearBroadcasterMapEntry,
         nullptr
     };
 
     if (! mBroadcasterMap) {
--- a/embedding/components/commandhandler/nsCommandParams.cpp
+++ b/embedding/components/commandhandler/nsCommandParams.cpp
@@ -11,18 +11,16 @@
 
 #include "nsCommandParams.h"
 #include "mozilla/HashFunctions.h"
 
 using namespace mozilla;
 
 const PLDHashTableOps nsCommandParams::sHashOps =
 {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   HashKey,
   HashMatchEntry,
   HashMoveEntry,
   HashClearEntry
 };
 
 NS_IMPL_ISUPPORTS(nsCommandParams, nsICommandParams)
 
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -617,18 +617,16 @@ FT2FontFamily::AddFacesToFontList(Infall
 #define CACHE_KEY "font.cached-list"
 
 class FontNameCache {
 public:
     FontNameCache()
         : mWriteNeeded(false)
     {
         mOps = (PLDHashTableOps) {
-            PL_DHashAllocTable,
-            PL_DHashFreeTable,
             StringHash,
             HashMatchEntry,
             MoveEntry,
             PL_DHashClearEntryStub,
             nullptr
         };
 
         PL_DHashTableInit(&mMap, &mOps, sizeof(FNCMapEntry), 0);
--- a/js/xpconnect/src/XPCMaps.cpp
+++ b/js/xpconnect/src/XPCMaps.cpp
@@ -207,18 +207,16 @@ Native2WrappedNativeMap::SizeOfEntryExcl
     return mallocSizeOf(((Native2WrappedNativeMap::Entry*)hdr)->value);
 }
 
 /***************************************************************************/
 // implement IID2WrappedJSClassMap...
 
 const struct PLDHashTableOps IID2WrappedJSClassMap::Entry::sOps =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashIIDPtrKey,
     MatchIIDPtrKey,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub
 };
 
 // static
 IID2WrappedJSClassMap*
@@ -243,18 +241,16 @@ IID2WrappedJSClassMap::~IID2WrappedJSCla
 }
 
 
 /***************************************************************************/
 // implement IID2NativeInterfaceMap...
 
 const struct PLDHashTableOps IID2NativeInterfaceMap::Entry::sOps =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashIIDPtrKey,
     MatchIIDPtrKey,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub
 };
 
 // static
 IID2NativeInterfaceMap*
@@ -447,18 +443,16 @@ NativeSetMap::Entry::Match(PLDHashTable 
         }
     }
 
     return true;
 }
 
 const struct PLDHashTableOps NativeSetMap::Entry::sOps =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashNativeKey,
     Match,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub
 };
 
 // static
 NativeSetMap*
@@ -513,18 +507,16 @@ void
 IID2ThisTranslatorMap::Entry::Clear(PLDHashTable *table, PLDHashEntryHdr *entry)
 {
     static_cast<Entry*>(entry)->value = nullptr;
     memset(entry, 0, table->EntrySize());
 }
 
 const struct PLDHashTableOps IID2ThisTranslatorMap::Entry::sOps =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashIIDPtrKey,
     Match,
     PL_DHashMoveEntryStub,
     Clear
 };
 
 // static
 IID2ThisTranslatorMap*
@@ -591,18 +583,16 @@ XPCNativeScriptableSharedMap::Entry::Mat
     if (!name1 || !name2)
         return name1 == name2;
 
     return 0 == strcmp(name1, name2);
 }
 
 const struct PLDHashTableOps XPCNativeScriptableSharedMap::Entry::sOps =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     Hash,
     Match,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub
 };
 
 // static
 XPCNativeScriptableSharedMap*
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -64,18 +64,16 @@ PlaceholderMapMatchEntry(PLDHashTable *t
     static_cast<const PlaceholderMapEntry*>(hdr);
   NS_ASSERTION(entry->placeholderFrame->GetOutOfFlowFrame() !=
                (void*)0xdddddddd,
                "Dead placeholder in placeholder map");
   return entry->placeholderFrame->GetOutOfFlowFrame() == key;
 }
 
 static const PLDHashTableOps PlaceholderMapOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PlaceholderMapMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr
 };
 
 //----------------------------------------------------------------------
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -357,84 +357,72 @@ RuleHash_NameSpaceTable_MatchEntry(PLDHa
   nsCSSSelector* selector = entry->mRules[0].mSelector;
   if (selector->IsPseudoElement()) {
     selector = selector->mNext;
   }
   return NS_PTR_TO_INT32(key) == selector->mNameSpace;
 }
 
 static const PLDHashTableOps RuleHash_TagTable_Ops = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RuleHash_TagTable_MatchEntry,
   RuleHash_TagTable_MoveEntry,
   RuleHash_TagTable_ClearEntry,
   RuleHash_TagTable_InitEntry
 };
 
 // Case-sensitive ops.
 static const RuleHashTableOps RuleHash_ClassTable_CSOps = {
   {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RuleHash_CSMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
   RuleHash_InitEntry
   },
   RuleHash_ClassTable_GetKey
 };
 
 // Case-insensitive ops.
 static const RuleHashTableOps RuleHash_ClassTable_CIOps = {
   {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   RuleHash_CIHashKey,
   RuleHash_CIMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
   RuleHash_InitEntry
   },
   RuleHash_ClassTable_GetKey
 };
 
 // Case-sensitive ops.
 static const RuleHashTableOps RuleHash_IdTable_CSOps = {
   {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RuleHash_CSMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
   RuleHash_InitEntry
   },
   RuleHash_IdTable_GetKey
 };
 
 // Case-insensitive ops.
 static const RuleHashTableOps RuleHash_IdTable_CIOps = {
   {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   RuleHash_CIHashKey,
   RuleHash_CIMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
   RuleHash_InitEntry
   },
   RuleHash_IdTable_GetKey
 };
 
 static const PLDHashTableOps RuleHash_NameSpaceTable_Ops = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   RuleHash_NameSpaceTable_HashKey,
   RuleHash_NameSpaceTable_MatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
   RuleHash_InitEntry
 };
 
 #undef RULE_HASH_STATS
@@ -882,30 +870,26 @@ static nsIAtom*
 AtomSelector_GetKey(PLDHashTable *table, const PLDHashEntryHdr *hdr)
 {
   const AtomSelectorEntry *entry = static_cast<const AtomSelectorEntry*>(hdr);
   return entry->mAtom;
 }
 
 // Case-sensitive ops.
 static const PLDHashTableOps AtomSelector_CSOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PL_DHashMatchEntryStub,
   AtomSelector_MoveEntry,
   AtomSelector_ClearEntry,
   AtomSelector_InitEntry
 };
 
 // Case-insensitive ops.
 static const RuleHashTableOps AtomSelector_CIOps = {
   {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   RuleHash_CIHashKey,
   RuleHash_CIMatchEntry,
   AtomSelector_MoveEntry,
   AtomSelector_ClearEntry,
   AtomSelector_InitEntry
   },
   AtomSelector_GetKey
 };
@@ -3332,18 +3316,16 @@ InitWeightEntry(PLDHashTable *table, PLD
                 const void *key)
 {
   RuleByWeightEntry* entry = static_cast<RuleByWeightEntry*>(hdr);
   new (entry) RuleByWeightEntry();
   return true;
 }
 
 static const PLDHashTableOps gRulesByWeightOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashIntKey,
     MatchWeightEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     InitWeightEntry
 };
 
 struct CascadeEnumData {
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -164,18 +164,16 @@ MappedAttrTable_MatchEntry(PLDHashTable 
     static_cast<nsMappedAttributes*>(const_cast<void*>(key));
   const MappedAttrTableEntry *entry =
     static_cast<const MappedAttrTableEntry*>(hdr);
 
   return attributes->Equals(entry->mAttributes);
 }
 
 static const PLDHashTableOps MappedAttrTable_Ops = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   MappedAttrTable_HashKey,
   MappedAttrTable_MatchEntry,
   PL_DHashMoveEntryStub,
   MappedAttrTable_ClearEntry,
   nullptr
 };
 
 // -----------------------------------------------------------
@@ -220,18 +218,16 @@ LangRuleTable_InitEntry(PLDHashTable *ta
 
   // Create the unique rule for this language
   entry->mRule = new nsHTMLStyleSheet::LangRule(*lang);
 
   return true;
 }
 
 static const PLDHashTableOps LangRuleTable_Ops = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   LangRuleTable_HashKey,
   LangRuleTable_MatchEntry,
   PL_DHashMoveEntryStub,
   LangRuleTable_ClearEntry,
   LangRuleTable_InitEntry
 };
 
 // -----------------------------------------------------------
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -109,18 +109,16 @@ nsRuleNode::ChildrenHashMatchEntry(PLDHa
 }
 
 /* static */ const PLDHashTableOps
 nsRuleNode::ChildrenHashOps = {
   // It's probably better to allocate the table itself using malloc and
   // free rather than the pres shell's arena because the table doesn't
   // grow very often and the pres shell's arena doesn't recycle very
   // large size allocations.
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   ChildrenHashHashKey,
   ChildrenHashMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr
 };
 
 
--- a/layout/tables/SpanningCellSorter.cpp
+++ b/layout/tables/SpanningCellSorter.cpp
@@ -28,18 +28,16 @@ SpanningCellSorter::~SpanningCellSorter(
         PL_DHashTableFinish(&mHashTable);
         mHashTable.ops = nullptr;
     }
     delete [] mSortedHashTable;
 }
 
 /* static */ const PLDHashTableOps
 SpanningCellSorter::HashTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashTableHashKey,
     HashTableMatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 /* static */ PLDHashNumber
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -72,18 +72,16 @@ bool                gDirty = false;
 static struct CallbackNode* gCallbacks = nullptr;
 static bool         gIsAnyPrefLocked = false;
 // These are only used during the call to pref_DoCallback
 static bool         gCallbacksInProgress = false;
 static bool         gShouldCleanupDeadNodes = false;
 
 
 static PLDHashTableOps     pref_HashTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     PL_DHashStringKey,
     matchPrefEntry,
     PL_DHashMoveEntryStub,
     clearPrefEntry,
     nullptr,
 };
 
 // PR_ALIGN_OF_WORD is only defined on some platforms.  ALIGN_OF_WORD has
--- a/netwerk/base/src/nsLoadGroup.cpp
+++ b/netwerk/base/src/nsLoadGroup.cpp
@@ -1151,18 +1151,16 @@ nsLoadGroupConnectionInfo::SetSpdyPushCa
     mSpdyCache = aSpdyPushCache;
     return NS_OK;
 }
 
 nsresult nsLoadGroup::Init()
 {
     static const PLDHashTableOps hash_table_ops =
     {
-        PL_DHashAllocTable,
-        PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         RequestHashMatchEntry,
         PL_DHashMoveEntryStub,
         RequestHashClearEntry,
         RequestHashInitEntry
     };
 
     PL_DHashTableInit(&mRequests, &hash_table_ops,
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -372,18 +372,16 @@ nsCacheEntryInfo::IsStreamBased(bool * r
 
 /******************************************************************************
  *  nsCacheEntryHashTable
  *****************************************************************************/
 
 const PLDHashTableOps
 nsCacheEntryHashTable::ops =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashKey,
     MatchEntry,
     MoveEntry,
     ClearEntry
 };
 
 
 nsCacheEntryHashTable::nsCacheEntryHashTable()
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -119,18 +119,16 @@ nsDiskCacheBinding::EnsureStreamIO()
  *  nsDiskCacheBindery
  *
  *  Keeps track of bound disk cache entries to detect for collisions.
  *
  *****************************************************************************/
 
 const PLDHashTableOps nsDiskCacheBindery::ops =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HashKey,
     MatchEntry,
     MoveEntry,
     ClearEntry
 };
 
 
 nsDiskCacheBindery::nsDiskCacheBindery()
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -458,18 +458,16 @@ HostDB_InitEntry(PLDHashTable *table,
 {
     nsHostDBEnt *he = static_cast<nsHostDBEnt *>(entry);
     nsHostRecord::Create(static_cast<const nsHostKey *>(key), &he->rec);
     return true;
 }
 
 static const PLDHashTableOps gHostDB_ops =
 {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     HostDB_HashKey,
     HostDB_MatchEntry,
     HostDB_MoveEntry,
     HostDB_ClearEntry,
     HostDB_InitEntry,
 };
 
 static PLDHashOperator
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -80,18 +80,16 @@ StringCompare(PLDHashTable *table, const
     const void *entryKey =
             reinterpret_cast<const PLDHashEntryStub *>(entry)->key;
 
     return PL_strcasecmp(reinterpret_cast<const char *>(entryKey),
                          reinterpret_cast<const char *>(testKey)) == 0;
 }
 
 static const PLDHashTableOps ops = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     StringHash,
     StringCompare,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 // We put the atoms in a hash table for speedy lookup.. see ResolveAtom.
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -47,28 +47,24 @@ static PLDHashNumber
   hashUnicodeValue(PLDHashTable*, const void* key)
 {
   // key is actually the unicode value
   return PLDHashNumber(NS_PTR_TO_INT32(key));
   }
 
 
 static const PLDHashTableOps EntityToUnicodeOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashStringKey,
   matchNodeString,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr,
 }; 
 
 static const PLDHashTableOps UnicodeToEntityOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   hashUnicodeValue,
   matchNodeUnicode,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr,
 };
 
 static PLDHashTable gEntityToUnicode;
--- a/rdf/base/nsRDFService.cpp
+++ b/rdf/base/nsRDFService.cpp
@@ -135,18 +135,16 @@ struct ResourceHashEntry : public PLDHas
             static_cast<const ResourceHashEntry *>(hdr);
 
         return 0 == nsCRT::strcmp(static_cast<const char *>(key),
                                   entry->mKey);
     }
 };
 
 static const PLDHashTableOps gResourceTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     ResourceHashEntry::HashKey,
     ResourceHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 // ----------------------------------------------------------------------
@@ -172,18 +170,16 @@ struct LiteralHashEntry : public PLDHash
             static_cast<const LiteralHashEntry *>(hdr);
 
         return 0 == nsCRT::strcmp(static_cast<const char16_t *>(key),
                                   entry->mKey);
     }
 };
 
 static const PLDHashTableOps gLiteralTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     LiteralHashEntry::HashKey,
     LiteralHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 // ----------------------------------------------------------------------
@@ -208,18 +204,16 @@ struct IntHashEntry : public PLDHashEntr
         const IntHashEntry *entry =
             static_cast<const IntHashEntry *>(hdr);
 
         return *static_cast<const int32_t *>(key) == entry->mKey;
     }
 };
 
 static const PLDHashTableOps gIntTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     IntHashEntry::HashKey,
     IntHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 // ----------------------------------------------------------------------
@@ -248,18 +242,16 @@ struct DateHashEntry : public PLDHashEnt
         const DateHashEntry *entry =
             static_cast<const DateHashEntry *>(hdr);
 
         return *static_cast<const PRTime *>(key) == entry->mKey;
     }
 };
 
 static const PLDHashTableOps gDateTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     DateHashEntry::HashKey,
     DateHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 class BlobImpl : public nsIRDFBlob
@@ -367,18 +359,16 @@ struct BlobHashEntry : public PLDHashEnt
             static_cast<const BlobImpl::Data *>(key);
 
         return (left->mLength == right->mLength)
             && 0 == memcmp(left->mBytes, right->mBytes, right->mLength);
     }
 };
 
 static const PLDHashTableOps gBlobTableOps = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     BlobHashEntry::HashKey,
     BlobHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
 };
 
 ////////////////////////////////////////////////////////////////////////
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -75,18 +75,16 @@ RequestMapInitEntry(PLDHashTable *table,
                      const void *key)
 {
   RequestHashEntry *entry = static_cast<RequestHashEntry*>(hdr);
   entry->r = (void*)key;
   return true;
 }
 
 static const PLDHashTableOps gMapOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RequestMapMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   RequestMapInitEntry
 };
 
 #ifdef DEBUG
--- a/security/manager/ssl/src/nsCertTree.cpp
+++ b/security/manager/ssl/src/nsCertTree.cpp
@@ -87,18 +87,16 @@ CompareCacheInitEntry(PLDHashTable *tabl
 static void
 CompareCacheClearEntry(PLDHashTable *table, PLDHashEntryHdr *hdr)
 {
   CompareCacheHashEntryPtr *entryPtr = static_cast<CompareCacheHashEntryPtr*>(hdr);
   entryPtr->~CompareCacheHashEntryPtr();
 }
 
 static const PLDHashTableOps gMapOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   CompareCacheMatchEntry,
   PL_DHashMoveEntryStub,
   CompareCacheClearEntry,
   CompareCacheInitEntry
 };
 
 NS_IMPL_ISUPPORTS0(nsCertAddonInfo)
--- a/security/manager/ssl/src/nsNSSShutDown.cpp
+++ b/security/manager/ssl/src/nsNSSShutDown.cpp
@@ -28,18 +28,16 @@ ObjectSetInitEntry(PLDHashTable *table, 
                      const void *key)
 {
   ObjectHashEntry *entry = static_cast<ObjectHashEntry*>(hdr);
   entry->obj = const_cast<nsNSSShutDownObject*>(static_cast<const nsNSSShutDownObject*>(key));
   return true;
 }
 
 static const PLDHashTableOps gSetOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   ObjectSetMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   ObjectSetInitEntry
 };
 
 nsNSSShutDownList *nsNSSShutDownList::singleton = nullptr;
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -109,18 +109,16 @@ nsDocLoader::nsDocLoader()
 #if defined(PR_LOGGING)
   if (nullptr == gDocLoaderLog) {
       gDocLoaderLog = PR_NewLogModule("DocLoader");
   }
 #endif /* PR_LOGGING */
 
   static const PLDHashTableOps hash_table_ops =
   {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     PL_DHashVoidPtrKeyStub,
     PL_DHashMatchEntryStub,
     PL_DHashMoveEntryStub,
     RequestInfoHashClearEntry,
     RequestInfoHashInitEntry
   };
 
   PL_DHashTableInit(&mRequestInfoHash, &hash_table_ops, sizeof(nsRequestInfo));
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -796,18 +796,16 @@ PtrToNodeMatchEntry(PLDHashTable* aTable
                     const PLDHashEntryHdr* aEntry,
                     const void* aKey)
 {
   const PtrToNodeEntry* n = static_cast<const PtrToNodeEntry*>(aEntry);
   return n->mNode->mPointer == aKey;
 }
 
 static PLDHashTableOps PtrNodeOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PtrToNodeMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr
 };
 
 
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -283,18 +283,16 @@ AtomTableInitEntry(PLDHashTable* aTable,
 {
   static_cast<AtomTableEntry*>(aEntry)->mAtom = nullptr;
 
   return true;
 }
 
 
 static const PLDHashTableOps AtomTableOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   AtomTableGetHash,
   AtomTableMatchKey,
   PL_DHashMoveEntryStub,
   AtomTableClearEntry,
   AtomTableInitEntry
 };
 
 
--- a/xpcom/ds/nsPersistentProperties.cpp
+++ b/xpcom/ds/nsPersistentProperties.cpp
@@ -45,18 +45,16 @@ ArenaStrdup(const nsAFlatCString& aStrin
   NS_ASSERTION(mem, "Couldn't allocate space!\n");
   if (mem) {
     memcpy(mem, aString.get(), len);
   }
   return static_cast<char*>(mem);
 }
 
 static const struct PLDHashTableOps property_HashTableOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashStringKey,
   PL_DHashMatchStringKey,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr,
 };
 
 //
--- a/xpcom/ds/nsStaticNameTable.cpp
+++ b/xpcom/ds/nsStaticNameTable.cpp
@@ -89,18 +89,16 @@ caseInsensitiveStringHashKey(PLDHashTabl
          s++) {
       h = AddToHash(h, *s & ~0x20);
     }
   }
   return h;
 }
 
 static const struct PLDHashTableOps nametable_CaseInsensitiveHashTableOps = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   caseInsensitiveStringHashKey,
   matchNameKeysCaseInsensitive,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr,
 };
 
 nsStaticCaseInsensitiveNameTable::nsStaticCaseInsensitiveNameTable()
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -414,18 +414,16 @@ nsTHashtable<EntryType>::~nsTHashtable()
 }
 
 template<class EntryType>
 void
 nsTHashtable<EntryType>::Init(uint32_t aInitLength)
 {
   static const PLDHashTableOps sOps =
   {
-    ::PL_DHashAllocTable,
-    ::PL_DHashFreeTable,
     s_HashKey,
     s_MatchEntry,
     EntryType::ALLOW_MEMMOVE ? ::PL_DHashMoveEntryStub : s_CopyEntry,
     s_ClearEntry,
     s_InitEntry
   };
 
   PL_DHashTableInit(&mTable, &sOps, sizeof(EntryType), aInitLength);
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -63,28 +63,16 @@
 
 #define INCREMENT_RECURSION_LEVEL(table_)   do { } while(0)
 #define DECREMENT_RECURSION_LEVEL(table_)   do { } while(0)
 
 #endif /* defined(DEBUG) */
 
 using namespace mozilla;
 
-void*
-PL_DHashAllocTable(PLDHashTable* aTable, uint32_t aNBytes)
-{
-  return malloc(aNBytes);
-}
-
-void
-PL_DHashFreeTable(PLDHashTable* aTable, void* aPtr)
-{
-  free(aPtr);
-}
-
 PLDHashNumber
 PL_DHashStringKey(PLDHashTable* aTable, const void* aKey)
 {
   return HashString(static_cast<const char*>(aKey));
 }
 
 PLDHashNumber
 PL_DHashVoidPtrKeyStub(PLDHashTable* aTable, const void* aKey)
@@ -153,18 +141,16 @@ PLDHashTable::FreeStringKey(PLDHashEntry
 
 void
 PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry)
 {
   aTable->FreeStringKey(aEntry);
 }
 
 static const PLDHashTableOps stub_ops = {
-  PL_DHashAllocTable,
-  PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PL_DHashMatchEntryStub,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
   nullptr
 };
 
 const PLDHashTableOps*
@@ -180,33 +166,33 @@ SizeOfEntryStore(uint32_t aCapacity, uin
   *aNbytes = aCapacity * aEntrySize;
   return uint64_t(*aNbytes) == nbytes64;   // returns false on overflow
 }
 
 PLDHashTable*
 PL_NewDHashTable(const PLDHashTableOps* aOps, uint32_t aEntrySize,
                  uint32_t aLength)
 {
-  PLDHashTable* table = (PLDHashTable*)aOps->allocTable(NULL, sizeof(*table));
+  PLDHashTable* table = (PLDHashTable*)malloc(sizeof(*table));
 
   if (!table) {
     return nullptr;
   }
   if (!PL_DHashTableInit(table, aOps, aEntrySize, fallible_t(), aLength)) {
-    aOps->freeTable(NULL, table);
+    free(table);
     return nullptr;
   }
   return table;
 }
 
 void
 PL_DHashTableDestroy(PLDHashTable* aTable)
 {
   PL_DHashTableFinish(aTable);
-  aTable->ops->freeTable(NULL, aTable);
+  free(aTable);
 }
 
 /*
  * Compute max and min load numbers (entry counts).  We have a secondary max
  * that allows us to overload a table reasonably if it cannot be grown further
  * (i.e. if ChangeTable() fails).  The table slows down drastically if the
  * secondary max is too close to 1, but 0.96875 gives only a slight slowdown
  * while allowing 1.3x more elements.
@@ -258,17 +244,17 @@ PLDHashTable::Init(const PLDHashTableOps
   mEntrySize = aEntrySize;
   mEntryCount = mRemovedCount = 0;
   mGeneration = 0;
   uint32_t nbytes;
   if (!SizeOfEntryStore(capacity, aEntrySize, &nbytes)) {
     return false;  // overflowed
   }
 
-  mEntryStore = (char*)aOps->allocTable(this, nbytes);
+  mEntryStore = (char*)malloc(nbytes);
   if (!mEntryStore) {
     return false;
   }
   memset(mEntryStore, 0, nbytes);
   METER(memset(&mStats, 0, sizeof(mStats)));
 
 #ifdef DEBUG
   mRecursionLevel = 0;
@@ -347,17 +333,17 @@ PLDHashTable::Finish()
     }
     entryAddr += mEntrySize;
   }
 
   DECREMENT_RECURSION_LEVEL(this);
   MOZ_ASSERT(RECURSION_LEVEL_SAFE_TO_FINISH(this));
 
   /* Free entry storage last. */
-  ops->freeTable(this, mEntryStore);
+  free(mEntryStore);
 }
 
 void
 PL_DHashTableFinish(PLDHashTable* aTable)
 {
   aTable->Finish();
 }
 
@@ -490,17 +476,17 @@ PLDHashTable::ChangeTable(int aDeltaLog2
     return false;
   }
 
   uint32_t nbytes;
   if (!SizeOfEntryStore(newCapacity, mEntrySize, &nbytes)) {
     return false;   // overflowed
   }
 
-  char* newEntryStore = (char*)ops->allocTable(this, nbytes);
+  char* newEntryStore = (char*)malloc(nbytes);
   if (!newEntryStore) {
     return false;
   }
 
   /* We can't fail from here on, so update table parameters. */
 #ifdef DEBUG
   uint32_t recursionLevelTmp = mRecursionLevel;
 #endif
@@ -529,17 +515,17 @@ PLDHashTable::ChangeTable(int aDeltaLog2
       NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(newEntry),
                    "PL_DHASH_ENTRY_IS_FREE(newEntry)");
       moveEntry(this, oldEntry, newEntry);
       newEntry->keyHash = oldEntry->keyHash;
     }
     oldEntryAddr += mEntrySize;
   }
 
-  ops->freeTable(this, oldEntryStore);
+  free(oldEntryStore);
   return true;
 }
 
 MOZ_ALWAYS_INLINE PLDHashEntryHdr*
 PLDHashTable::Operate(const void* aKey, PLDHashOperator aOp)
 {
   PLDHashEntryHdr* entry;
 
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -295,25 +295,16 @@ private:
     SearchTable(const void* aKey, PLDHashNumber aKeyHash, PLDHashOperator aOp);
 
   PLDHashEntryHdr* PL_DHASH_FASTCALL FindFreeEntry(PLDHashNumber aKeyHash);
 
   bool ChangeTable(int aDeltaLog2);
 };
 
 /*
- * Table space at mEntryStore is allocated and freed using these callbacks.
- * The allocator should return null on error only (not if called with aNBytes
- * equal to 0; but note that pldhash.c code will never call with 0 aNBytes).
- */
-typedef void* (*PLDHashAllocTable)(PLDHashTable* aTable, uint32_t aNBytes);
-
-typedef void (*PLDHashFreeTable)(PLDHashTable* aTable, void* aPtr);
-
-/*
  * Compute the hash code for a given key to be looked up, added, or removed
  * from aTable.  A hash code may have any PLDHashNumber value.
  */
 typedef PLDHashNumber (*PLDHashHashKey)(PLDHashTable* aTable,
                                         const void* aKey);
 
 /*
  * Compare the key identifying aEntry in aTable with the provided key parameter.
@@ -347,23 +338,21 @@ typedef void (*PLDHashClearEntry)(PLDHas
  * given key, and must add a new one.  At that point, aEntry->keyHash is not
  * set yet, to avoid claiming the last free entry in a severely overloaded
  * table.
  */
 typedef bool (*PLDHashInitEntry)(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
                                  const void* aKey);
 
 /*
- * Finally, the "vtable" structure for PLDHashTable.  The first six hooks
+ * Finally, the "vtable" structure for PLDHashTable.  The first four hooks
  * must be provided by implementations; they're called unconditionally by the
  * generic pldhash.c code.  Hooks after these may be null.
  *
  * Summary of allocation-related hook usage with C++ placement new emphasis:
- *  allocTable          Allocate raw bytes with malloc, no ctors run.
- *  freeTable           Free raw bytes with free, no dtors run.
  *  initEntry           Call placement new using default key-based ctor.
  *                      Return true on success, false on error.
  *  moveEntry           Call placement new using copy ctor, run dtor on old
  *                      entry storage.
  *  clearEntry          Run dtor on entry.
  *
  * Note the reason why initEntry is optional: the default hooks (stubs) clear
  * entry storage:  On successful PL_DHashTableOperate(tbl, key, PL_DHASH_ADD),
@@ -374,33 +363,28 @@ typedef bool (*PLDHashInitEntry)(PLDHash
  * new or similar initialization is required, define an initEntry hook.  Of
  * course, the clearEntry hook must zero or null appropriately.
  *
  * XXX assumes 0 is null for pointer types.
  */
 struct PLDHashTableOps
 {
   /* Mandatory hooks.  All implementations must provide these. */
-  PLDHashAllocTable   allocTable;
-  PLDHashFreeTable    freeTable;
   PLDHashHashKey      hashKey;
   PLDHashMatchEntry   matchEntry;
   PLDHashMoveEntry    moveEntry;
   PLDHashClearEntry   clearEntry;
 
   /* Optional hooks start here.  If null, these are not called. */
   PLDHashInitEntry    initEntry;
 };
 
 /*
  * Default implementations for the above ops.
  */
-void* PL_DHashAllocTable(PLDHashTable* aTable, uint32_t aNBytes);
-
-void PL_DHashFreeTable(PLDHashTable* aTable, void* aPtr);
 
 PLDHashNumber PL_DHashStringKey(PLDHashTable* aTable, const void* aKey);
 
 /* A minimal entry contains a keyHash header and a void key pointer. */
 struct PLDHashEntryStub
 {
   PLDHashEntryHdr hdr;
   const void*     key;
@@ -428,20 +412,18 @@ void PL_DHashFreeStringKey(PLDHashTable*
 /*
  * 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);
 
 /*
- * Dynamically allocate a new PLDHashTable using malloc, initialize it using
- * PL_DHashTableInit, and return its address.  Return null on malloc failure.
- * Note that the entry storage at aTable->mEntryStore will be allocated using
- * the aOps->allocTable callback.
+ * Dynamically allocate a new PLDHashTable, initialize it using
+ * PL_DHashTableInit, and return its address. Return null on allocation failure.
  */
 PLDHashTable* PL_NewDHashTable(
   const PLDHashTableOps* aOps, uint32_t aEntrySize,
   uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);
 
 /*
  * Free |aTable|'s entry storage and |aTable| itself (both via
  * aTable->ops->freeTable). Use this function to destroy a PLDHashTable that
@@ -485,19 +467,19 @@ void PL_DHashTableFinish(PLDHashTable* a
  * If PL_DHASH_ENTRY_IS_BUSY(entry) is true, key was found and it identifies
  * entry.  If PL_DHASH_ENTRY_IS_FREE(entry) is true, key was not found.
  *
  * To add an entry identified by key to table, call:
  *
  *  entry = PL_DHashTableOperate(table, key, PL_DHASH_ADD);
  *
  * If entry is null upon return, then either the table is severely overloaded,
- * and memory can't be allocated for entry storage via aTable->ops->allocTable;
- * Or if aTable->ops->initEntry is non-null, the aTable->ops->initEntry op may
- * have returned false.
+ * and memory can't be allocated for entry storage. Or if
+ * aTable->ops->initEntry is non-null, the aTable->ops->initEntry op may have
+ * returned false.
  *
  * Otherwise, aEntry->keyHash has been set so that PL_DHASH_ENTRY_IS_BUSY(entry)
  * is true, and it is up to the caller to initialize the key and value parts
  * of the entry sub-type, if they have not been set already (i.e. if entry was
  * not already in the table, and if the optional initEntry hook was not used).
  *
  * To remove an entry identified by key from table, call:
  *
--- a/xpcom/tests/TestPLDHash.cpp
+++ b/xpcom/tests/TestPLDHash.cpp
@@ -75,18 +75,16 @@ static PLDHashNumber
 hash(PLDHashTable *table, const void *key)
 {
   return (PLDHashNumber)(size_t)key;
 }
 
 static bool test_pldhash_grow_to_max_capacity()
 {
   static const PLDHashTableOps ops = {
-    PL_DHashAllocTable,
-    PL_DHashFreeTable,
     hash,
     PL_DHashMatchEntryStub,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
     nullptr
   };
 
   PLDHashTable t;