diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp index 0021011bdb43..bcdf11abe589 100644 --- a/dom/base/nsContentList.cpp +++ b/dom/base/nsContentList.cpp @@ -208,8 +208,6 @@ NS_GetContentList(nsINode* aRootNode, static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, ContentListHashtableHashKey, ContentListHashtableMatchEntry, PL_DHashMoveEntryStub, @@ -320,8 +318,6 @@ GetFuncStringContentList(nsINode* aRootNode, static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, FuncStringContentListHashtableHashKey, FuncStringContentListHashtableMatchEntry, PL_DHashMoveEntryStub, diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index ac4bb1d93e32..7738c7cac5c1 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -479,8 +479,6 @@ nsContentUtils::Init() if (!sEventListenerManagersHash.ops) { static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, PL_DHashMoveEntryStub, diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 483465c0b256..0b3797929cfe 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3972,8 +3972,6 @@ nsDocument::SetSubDocumentFor(Element* aElement, nsIDocument* aSubDoc) static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, PL_DHashMoveEntryStub, diff --git a/dom/base/nsScriptNameSpaceManager.cpp b/dom/base/nsScriptNameSpaceManager.cpp index 61693bd1e9fd..6811dc07d988 100644 --- a/dom/base/nsScriptNameSpaceManager.cpp +++ b/dom/base/nsScriptNameSpaceManager.cpp @@ -320,8 +320,6 @@ nsScriptNameSpaceManager::Init() { static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, GlobalNameHashHashKey, GlobalNameHashMatchEntry, PL_DHashMoveEntryStub, diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp index dd5f816ba7ee..2e90e013df0e 100644 --- a/dom/xul/XULDocument.cpp +++ b/dom/xul/XULDocument.cpp @@ -760,8 +760,6 @@ XULDocument::AddBroadcastListenerFor(Element& aBroadcaster, Element& aListener, } static const PLDHashTableOps gOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, PL_DHashMoveEntryStub, diff --git a/embedding/components/commandhandler/nsCommandParams.cpp b/embedding/components/commandhandler/nsCommandParams.cpp index e476b3e72f4f..79aaa69e4e77 100644 --- a/embedding/components/commandhandler/nsCommandParams.cpp +++ b/embedding/components/commandhandler/nsCommandParams.cpp @@ -16,8 +16,6 @@ using namespace mozilla; const PLDHashTableOps nsCommandParams::sHashOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashKey, HashMatchEntry, HashMoveEntry, diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 6c2f8c7a990e..7bf8cd99809a 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -622,8 +622,6 @@ public: : mWriteNeeded(false) { mOps = (PLDHashTableOps) { - PL_DHashAllocTable, - PL_DHashFreeTable, StringHash, HashMatchEntry, MoveEntry, diff --git a/js/xpconnect/src/XPCMaps.cpp b/js/xpconnect/src/XPCMaps.cpp index 342f9ea8d8bd..c70846f570bb 100644 --- a/js/xpconnect/src/XPCMaps.cpp +++ b/js/xpconnect/src/XPCMaps.cpp @@ -212,8 +212,6 @@ Native2WrappedNativeMap::SizeOfEntryExcludingThis(PLDHashEntryHdr *hdr, const struct PLDHashTableOps IID2WrappedJSClassMap::Entry::sOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashIIDPtrKey, MatchIIDPtrKey, PL_DHashMoveEntryStub, @@ -248,8 +246,6 @@ IID2WrappedJSClassMap::~IID2WrappedJSClassMap() const struct PLDHashTableOps IID2NativeInterfaceMap::Entry::sOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashIIDPtrKey, MatchIIDPtrKey, PL_DHashMoveEntryStub, @@ -452,8 +448,6 @@ NativeSetMap::Entry::Match(PLDHashTable *table, const struct PLDHashTableOps NativeSetMap::Entry::sOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashNativeKey, Match, PL_DHashMoveEntryStub, @@ -518,8 +512,6 @@ IID2ThisTranslatorMap::Entry::Clear(PLDHashTable *table, PLDHashEntryHdr *entry) const struct PLDHashTableOps IID2ThisTranslatorMap::Entry::sOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashIIDPtrKey, Match, PL_DHashMoveEntryStub, @@ -596,8 +588,6 @@ XPCNativeScriptableSharedMap::Entry::Match(PLDHashTable *table, const struct PLDHashTableOps XPCNativeScriptableSharedMap::Entry::sOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, Hash, Match, PL_DHashMoveEntryStub, diff --git a/layout/base/nsFrameManager.cpp b/layout/base/nsFrameManager.cpp index 027396731127..e415153577d0 100644 --- a/layout/base/nsFrameManager.cpp +++ b/layout/base/nsFrameManager.cpp @@ -69,8 +69,6 @@ PlaceholderMapMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr, } static const PLDHashTableOps PlaceholderMapOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PlaceholderMapMatchEntry, PL_DHashMoveEntryStub, diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index c8fedcfc48bd..b2c4ec6c9a18 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -362,8 +362,6 @@ RuleHash_NameSpaceTable_MatchEntry(PLDHashTable *table, } static const PLDHashTableOps RuleHash_TagTable_Ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, RuleHash_TagTable_MatchEntry, RuleHash_TagTable_MoveEntry, @@ -374,8 +372,6 @@ static const PLDHashTableOps RuleHash_TagTable_Ops = { // Case-sensitive ops. static const RuleHashTableOps RuleHash_ClassTable_CSOps = { { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, RuleHash_CSMatchEntry, RuleHash_MoveEntry, @@ -388,8 +384,6 @@ static const RuleHashTableOps RuleHash_ClassTable_CSOps = { // Case-insensitive ops. static const RuleHashTableOps RuleHash_ClassTable_CIOps = { { - PL_DHashAllocTable, - PL_DHashFreeTable, RuleHash_CIHashKey, RuleHash_CIMatchEntry, RuleHash_MoveEntry, @@ -402,8 +396,6 @@ static const RuleHashTableOps RuleHash_ClassTable_CIOps = { // Case-sensitive ops. static const RuleHashTableOps RuleHash_IdTable_CSOps = { { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, RuleHash_CSMatchEntry, RuleHash_MoveEntry, @@ -416,8 +408,6 @@ static const RuleHashTableOps RuleHash_IdTable_CSOps = { // Case-insensitive ops. static const RuleHashTableOps RuleHash_IdTable_CIOps = { { - PL_DHashAllocTable, - PL_DHashFreeTable, RuleHash_CIHashKey, RuleHash_CIMatchEntry, RuleHash_MoveEntry, @@ -428,8 +418,6 @@ static const RuleHashTableOps RuleHash_IdTable_CIOps = { }; static const PLDHashTableOps RuleHash_NameSpaceTable_Ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, RuleHash_NameSpaceTable_HashKey, RuleHash_NameSpaceTable_MatchEntry, RuleHash_MoveEntry, @@ -887,8 +875,6 @@ AtomSelector_GetKey(PLDHashTable *table, const PLDHashEntryHdr *hdr) // Case-sensitive ops. static const PLDHashTableOps AtomSelector_CSOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, AtomSelector_MoveEntry, @@ -899,8 +885,6 @@ static const PLDHashTableOps AtomSelector_CSOps = { // Case-insensitive ops. static const RuleHashTableOps AtomSelector_CIOps = { { - PL_DHashAllocTable, - PL_DHashFreeTable, RuleHash_CIHashKey, RuleHash_CIMatchEntry, AtomSelector_MoveEntry, @@ -3337,8 +3321,6 @@ InitWeightEntry(PLDHashTable *table, PLDHashEntryHdr *hdr, } static const PLDHashTableOps gRulesByWeightOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashIntKey, MatchWeightEntry, PL_DHashMoveEntryStub, diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index 1184501ac7c2..80a34b6cad8e 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -169,8 +169,6 @@ MappedAttrTable_MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr, } static const PLDHashTableOps MappedAttrTable_Ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, MappedAttrTable_HashKey, MappedAttrTable_MatchEntry, PL_DHashMoveEntryStub, @@ -225,8 +223,6 @@ LangRuleTable_InitEntry(PLDHashTable *table, PLDHashEntryHdr *hdr, } static const PLDHashTableOps LangRuleTable_Ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, LangRuleTable_HashKey, LangRuleTable_MatchEntry, PL_DHashMoveEntryStub, diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index eb63ba2306e0..180a8bfe6479 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -114,8 +114,6 @@ nsRuleNode::ChildrenHashOps = { // 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, diff --git a/layout/tables/SpanningCellSorter.cpp b/layout/tables/SpanningCellSorter.cpp index 28c68e53da67..a9f7c542b026 100644 --- a/layout/tables/SpanningCellSorter.cpp +++ b/layout/tables/SpanningCellSorter.cpp @@ -33,8 +33,6 @@ SpanningCellSorter::~SpanningCellSorter() /* static */ const PLDHashTableOps SpanningCellSorter::HashTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashTableHashKey, HashTableMatchEntry, PL_DHashMoveEntryStub, diff --git a/modules/libpref/prefapi.cpp b/modules/libpref/prefapi.cpp index 51424ff285df..a4f534086eb3 100644 --- a/modules/libpref/prefapi.cpp +++ b/modules/libpref/prefapi.cpp @@ -77,8 +77,6 @@ static bool gShouldCleanupDeadNodes = false; static PLDHashTableOps pref_HashTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashStringKey, matchPrefEntry, PL_DHashMoveEntryStub, diff --git a/netwerk/base/src/nsLoadGroup.cpp b/netwerk/base/src/nsLoadGroup.cpp index 153590baae6e..4cc74cfcc1db 100644 --- a/netwerk/base/src/nsLoadGroup.cpp +++ b/netwerk/base/src/nsLoadGroup.cpp @@ -1156,8 +1156,6 @@ nsresult nsLoadGroup::Init() { static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, RequestHashMatchEntry, PL_DHashMoveEntryStub, diff --git a/netwerk/cache/nsCacheEntry.cpp b/netwerk/cache/nsCacheEntry.cpp index bd8b8a24c558..56735d683fdc 100644 --- a/netwerk/cache/nsCacheEntry.cpp +++ b/netwerk/cache/nsCacheEntry.cpp @@ -377,8 +377,6 @@ nsCacheEntryInfo::IsStreamBased(bool * result) const PLDHashTableOps nsCacheEntryHashTable::ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashKey, MatchEntry, MoveEntry, diff --git a/netwerk/cache/nsDiskCacheBinding.cpp b/netwerk/cache/nsDiskCacheBinding.cpp index 24b6c48831f7..7356bfc0ef1b 100644 --- a/netwerk/cache/nsDiskCacheBinding.cpp +++ b/netwerk/cache/nsDiskCacheBinding.cpp @@ -124,8 +124,6 @@ nsDiskCacheBinding::EnsureStreamIO() const PLDHashTableOps nsDiskCacheBindery::ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, HashKey, MatchEntry, MoveEntry, diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index 165ce2d0254a..9a36663f591c 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -463,8 +463,6 @@ HostDB_InitEntry(PLDHashTable *table, static const PLDHashTableOps gHostDB_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, HostDB_HashKey, HostDB_MatchEntry, HostDB_MoveEntry, diff --git a/netwerk/protocol/http/nsHttp.cpp b/netwerk/protocol/http/nsHttp.cpp index 3f72aa548b30..5f49d8a2a5ce 100644 --- a/netwerk/protocol/http/nsHttp.cpp +++ b/netwerk/protocol/http/nsHttp.cpp @@ -85,8 +85,6 @@ StringCompare(PLDHashTable *table, const PLDHashEntryHdr *entry, } static const PLDHashTableOps ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, StringHash, StringCompare, PL_DHashMoveEntryStub, diff --git a/parser/htmlparser/nsHTMLEntities.cpp b/parser/htmlparser/nsHTMLEntities.cpp index 68ca4135d15e..9120ca85ad25 100644 --- a/parser/htmlparser/nsHTMLEntities.cpp +++ b/parser/htmlparser/nsHTMLEntities.cpp @@ -52,8 +52,6 @@ static PLDHashNumber static const PLDHashTableOps EntityToUnicodeOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashStringKey, matchNodeString, PL_DHashMoveEntryStub, @@ -62,8 +60,6 @@ static const PLDHashTableOps EntityToUnicodeOps = { }; static const PLDHashTableOps UnicodeToEntityOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, hashUnicodeValue, matchNodeUnicode, PL_DHashMoveEntryStub, diff --git a/rdf/base/nsRDFService.cpp b/rdf/base/nsRDFService.cpp index 5c34b8895e85..94539dd8d88e 100644 --- a/rdf/base/nsRDFService.cpp +++ b/rdf/base/nsRDFService.cpp @@ -140,8 +140,6 @@ struct ResourceHashEntry : public PLDHashEntryHdr { }; static const PLDHashTableOps gResourceTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, ResourceHashEntry::HashKey, ResourceHashEntry::MatchEntry, PL_DHashMoveEntryStub, @@ -177,8 +175,6 @@ struct LiteralHashEntry : public PLDHashEntryHdr { }; static const PLDHashTableOps gLiteralTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, LiteralHashEntry::HashKey, LiteralHashEntry::MatchEntry, PL_DHashMoveEntryStub, @@ -213,8 +209,6 @@ struct IntHashEntry : public PLDHashEntryHdr { }; static const PLDHashTableOps gIntTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, IntHashEntry::HashKey, IntHashEntry::MatchEntry, PL_DHashMoveEntryStub, @@ -253,8 +247,6 @@ struct DateHashEntry : public PLDHashEntryHdr { }; static const PLDHashTableOps gDateTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, DateHashEntry::HashKey, DateHashEntry::MatchEntry, PL_DHashMoveEntryStub, @@ -372,8 +364,6 @@ struct BlobHashEntry : public PLDHashEntryHdr { }; static const PLDHashTableOps gBlobTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, BlobHashEntry::HashKey, BlobHashEntry::MatchEntry, PL_DHashMoveEntryStub, diff --git a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp index f064cc43e62c..936d0e07a1cd 100644 --- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp +++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp @@ -80,8 +80,6 @@ RequestMapInitEntry(PLDHashTable *table, PLDHashEntryHdr *hdr, } static const PLDHashTableOps gMapOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, RequestMapMatchEntry, PL_DHashMoveEntryStub, diff --git a/security/manager/ssl/src/nsCertTree.cpp b/security/manager/ssl/src/nsCertTree.cpp index 58d6265510e6..e6ffa179919f 100644 --- a/security/manager/ssl/src/nsCertTree.cpp +++ b/security/manager/ssl/src/nsCertTree.cpp @@ -92,8 +92,6 @@ CompareCacheClearEntry(PLDHashTable *table, PLDHashEntryHdr *hdr) } static const PLDHashTableOps gMapOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, CompareCacheMatchEntry, PL_DHashMoveEntryStub, diff --git a/security/manager/ssl/src/nsNSSShutDown.cpp b/security/manager/ssl/src/nsNSSShutDown.cpp index 1f42a0674455..93e091384e89 100644 --- a/security/manager/ssl/src/nsNSSShutDown.cpp +++ b/security/manager/ssl/src/nsNSSShutDown.cpp @@ -33,8 +33,6 @@ ObjectSetInitEntry(PLDHashTable *table, PLDHashEntryHdr *hdr, } static const PLDHashTableOps gSetOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, ObjectSetMatchEntry, PL_DHashMoveEntryStub, diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 7eb458ed15cc..312de92c05d0 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -114,8 +114,6 @@ nsDocLoader::nsDocLoader() static const PLDHashTableOps hash_table_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, PL_DHashMoveEntryStub, diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index f7b4f4b5391c..e6b9c5429165 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -801,8 +801,6 @@ PtrToNodeMatchEntry(PLDHashTable* aTable, } static PLDHashTableOps PtrNodeOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PtrToNodeMatchEntry, PL_DHashMoveEntryStub, diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index f8a698f9334b..2d302ab3fb99 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -288,8 +288,6 @@ AtomTableInitEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry, static const PLDHashTableOps AtomTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, AtomTableGetHash, AtomTableMatchKey, PL_DHashMoveEntryStub, diff --git a/xpcom/ds/nsPersistentProperties.cpp b/xpcom/ds/nsPersistentProperties.cpp index 6b9f28cc8421..3de7134b0152 100644 --- a/xpcom/ds/nsPersistentProperties.cpp +++ b/xpcom/ds/nsPersistentProperties.cpp @@ -50,8 +50,6 @@ ArenaStrdup(const nsAFlatCString& aString, PLArenaPool* aArena) } static const struct PLDHashTableOps property_HashTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashStringKey, PL_DHashMatchStringKey, PL_DHashMoveEntryStub, diff --git a/xpcom/ds/nsStaticNameTable.cpp b/xpcom/ds/nsStaticNameTable.cpp index df18d75fc564..09663f72153b 100644 --- a/xpcom/ds/nsStaticNameTable.cpp +++ b/xpcom/ds/nsStaticNameTable.cpp @@ -94,8 +94,6 @@ caseInsensitiveStringHashKey(PLDHashTable* aTable, const void* aKey) } static const struct PLDHashTableOps nametable_CaseInsensitiveHashTableOps = { - PL_DHashAllocTable, - PL_DHashFreeTable, caseInsensitiveStringHashKey, matchNameKeysCaseInsensitive, PL_DHashMoveEntryStub, diff --git a/xpcom/glue/nsTHashtable.h b/xpcom/glue/nsTHashtable.h index c01c71bf43f3..bd3ccc1f3e80 100644 --- a/xpcom/glue/nsTHashtable.h +++ b/xpcom/glue/nsTHashtable.h @@ -419,8 +419,6 @@ nsTHashtable::Init(uint32_t aInitLength) { static const PLDHashTableOps sOps = { - ::PL_DHashAllocTable, - ::PL_DHashFreeTable, s_HashKey, s_MatchEntry, EntryType::ALLOW_MEMMOVE ? ::PL_DHashMoveEntryStub : s_CopyEntry, diff --git a/xpcom/glue/pldhash.cpp b/xpcom/glue/pldhash.cpp index df2ecc74d2e0..bde970a27c5c 100644 --- a/xpcom/glue/pldhash.cpp +++ b/xpcom/glue/pldhash.cpp @@ -68,18 +68,6 @@ 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) { @@ -158,8 +146,6 @@ PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry) } static const PLDHashTableOps stub_ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, PL_DHashVoidPtrKeyStub, PL_DHashMatchEntryStub, PL_DHashMoveEntryStub, @@ -185,13 +171,13 @@ 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; @@ -201,7 +187,7 @@ void PL_DHashTableDestroy(PLDHashTable* aTable) { PL_DHashTableFinish(aTable); - aTable->ops->freeTable(NULL, aTable); + free(aTable); } /* @@ -263,7 +249,7 @@ PLDHashTable::Init(const PLDHashTableOps* aOps, return false; // overflowed } - mEntryStore = (char*)aOps->allocTable(this, nbytes); + mEntryStore = (char*)malloc(nbytes); if (!mEntryStore) { return false; } @@ -352,7 +338,7 @@ PLDHashTable::Finish() MOZ_ASSERT(RECURSION_LEVEL_SAFE_TO_FINISH(this)); /* Free entry storage last. */ - ops->freeTable(this, mEntryStore); + free(mEntryStore); } void @@ -495,7 +481,7 @@ PLDHashTable::ChangeTable(int aDeltaLog2) return false; // overflowed } - char* newEntryStore = (char*)ops->allocTable(this, nbytes); + char* newEntryStore = (char*)malloc(nbytes); if (!newEntryStore) { return false; } @@ -534,7 +520,7 @@ PLDHashTable::ChangeTable(int aDeltaLog2) oldEntryAddr += mEntrySize; } - ops->freeTable(this, oldEntryStore); + free(oldEntryStore); return true; } diff --git a/xpcom/glue/pldhash.h b/xpcom/glue/pldhash.h index d8ef706fc4e0..8a6c2d21c232 100644 --- a/xpcom/glue/pldhash.h +++ b/xpcom/glue/pldhash.h @@ -299,15 +299,6 @@ private: 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. @@ -352,13 +343,11 @@ 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 @@ -379,8 +368,6 @@ typedef bool (*PLDHashInitEntry)(PLDHashTable* aTable, PLDHashEntryHdr* aEntry, struct PLDHashTableOps { /* Mandatory hooks. All implementations must provide these. */ - PLDHashAllocTable allocTable; - PLDHashFreeTable freeTable; PLDHashHashKey hashKey; PLDHashMatchEntry matchEntry; PLDHashMoveEntry moveEntry; @@ -393,9 +380,6 @@ struct PLDHashTableOps /* * 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); @@ -433,10 +417,8 @@ void PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); 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, @@ -490,9 +472,9 @@ void PL_DHashTableFinish(PLDHashTable* aTable); * 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 diff --git a/xpcom/tests/TestPLDHash.cpp b/xpcom/tests/TestPLDHash.cpp index 81a8aa91f340..d465670c281a 100644 --- a/xpcom/tests/TestPLDHash.cpp +++ b/xpcom/tests/TestPLDHash.cpp @@ -80,8 +80,6 @@ hash(PLDHashTable *table, const void *key) static bool test_pldhash_grow_to_max_capacity() { static const PLDHashTableOps ops = { - PL_DHashAllocTable, - PL_DHashFreeTable, hash, PL_DHashMatchEntryStub, PL_DHashMoveEntryStub,