Bug 1159972 - Remove the fallible version of PL_DHashTableInit(). r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 29 Apr 2015 16:38:29 -0700
changeset 273314 efa98fd2a0450d3355ff5ae233aba3cb52dfe628
parent 273313 5242ffa9e8d558d70164d5849b83cc4a565c3963
child 273315 7bc6ca1495610504491cc2c0634441a9b8abd873
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1159972
milestone40.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 1159972 - Remove the fallible version of PL_DHashTableInit(). r=froydnj. It's no longer needed now that entry storage isn't allocated there. (The other possible causes of failures in that function are less interesting and simply crashing is a reasonable thing to do for them.) This also makes PL_DNewHashTable() infallible, so I removed some now-unnecessary checks of its result.
dom/base/nsDocument.cpp
dom/base/nsScriptNameSpaceManager.cpp
dom/xul/XULDocument.cpp
layout/style/nsRuleNode.cpp
modules/libpref/prefapi.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/protocol/http/nsHttp.cpp
parser/htmlparser/nsHTMLEntities.cpp
security/manager/ssl/src/nsCertTree.cpp
xpcom/ds/nsStaticNameTable.cpp
xpcom/glue/pldhash.cpp
xpcom/glue/pldhash.h
xpcom/tests/TestPLDHash.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -4042,19 +4042,16 @@ nsDocument::SetSubDocumentFor(Element* a
         PL_DHashVoidPtrKeyStub,
         PL_DHashMatchEntryStub,
         PL_DHashMoveEntryStub,
         SubDocClearEntry,
         SubDocInitEntry
       };
 
       mSubDocuments = PL_NewDHashTable(&hash_table_ops, sizeof(SubDocMapEntry));
-      if (!mSubDocuments) {
-        return NS_ERROR_OUT_OF_MEMORY;
-      }
     }
 
     // Add a mapping to the hash table
     SubDocMapEntry *entry = static_cast<SubDocMapEntry*>
       (PL_DHashTableAdd(mSubDocuments, aElement, fallible));
 
     if (!entry) {
       return NS_ERROR_OUT_OF_MEMORY;
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -318,31 +318,25 @@ nsScriptNameSpaceManager::Init()
   {
     GlobalNameHashHashKey,
     GlobalNameHashMatchEntry,
     PL_DHashMoveEntryStub,
     GlobalNameHashClearEntry,
     GlobalNameHashInitEntry
   };
 
-  mIsInitialized = PL_DHashTableInit(&mGlobalNames, &hash_table_ops,
-                                     sizeof(GlobalNameMapEntry),
-                                     fallible,
-                                     GLOBALNAME_HASHTABLE_INITIAL_LENGTH);
-  NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_OUT_OF_MEMORY);
+  PL_DHashTableInit(&mGlobalNames, &hash_table_ops,
+                    sizeof(GlobalNameMapEntry),
+                    GLOBALNAME_HASHTABLE_INITIAL_LENGTH);
 
-  mIsInitialized = PL_DHashTableInit(&mNavigatorNames, &hash_table_ops,
-                                     sizeof(GlobalNameMapEntry),
-                                     fallible,
-                                     GLOBALNAME_HASHTABLE_INITIAL_LENGTH);
-  if (!mIsInitialized) {
-    PL_DHashTableFinish(&mGlobalNames);
+  PL_DHashTableInit(&mNavigatorNames, &hash_table_ops,
+                    sizeof(GlobalNameMapEntry),
+                    GLOBALNAME_HASHTABLE_INITIAL_LENGTH);
 
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
+  mIsInitialized = true;
 
   RegisterWeakMemoryReporter(this);
 
   nsresult rv = NS_OK;
 
   rv = RegisterExternalInterfaces(false);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -764,21 +764,16 @@ XULDocument::AddBroadcastListenerFor(Ele
         PL_DHashMatchEntryStub,
         PL_DHashMoveEntryStub,
         ClearBroadcasterMapEntry,
         nullptr
     };
 
     if (! mBroadcasterMap) {
         mBroadcasterMap = PL_NewDHashTable(&gOps, sizeof(BroadcasterMapEntry));
-
-        if (! mBroadcasterMap) {
-            aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
-            return;
-        }
     }
 
     BroadcasterMapEntry* entry =
         static_cast<BroadcasterMapEntry*>
                    (PL_DHashTableSearch(mBroadcasterMap, &aBroadcaster));
 
     if (!entry) {
         entry = static_cast<BroadcasterMapEntry*>
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1612,18 +1612,16 @@ void nsRuleNode::SetUsedDirectly()
 void
 nsRuleNode::ConvertChildrenToHash(int32_t aNumKids)
 {
   NS_ASSERTION(!ChildrenAreHashed() && HaveChildren(),
                "must have a non-empty list of children");
   PLDHashTable *hash = PL_NewDHashTable(&ChildrenHashOps,
                                         sizeof(ChildrenHashEntry),
                                         aNumKids);
-  if (!hash)
-    return;
   for (nsRuleNode* curr = ChildrenList(); curr; curr = curr->mNextSibling) {
     // This will never fail because of the initial size we gave the table.
     ChildrenHashEntry *entry = static_cast<ChildrenHashEntry*>(
       PL_DHashTableAdd(hash, curr->mRule, fallible));
     NS_ASSERTION(!entry->mRuleNode, "duplicate entries in list");
     entry->mRuleNode = curr;
   }
   SetChildrenHash(hash);
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -144,21 +144,18 @@ enum {
 };
 static nsresult pref_HashPref(const char *key, PrefValue value, PrefType type, uint32_t flags);
 
 #define PREF_HASHTABLE_INITIAL_LENGTH   1024
 
 nsresult PREF_Init()
 {
     if (!gHashTable.IsInitialized()) {
-        if (!PL_DHashTableInit(&gHashTable, &pref_HashTableOps,
-                               sizeof(PrefHashEntry), fallible,
-                               PREF_HASHTABLE_INITIAL_LENGTH)) {
-            return NS_ERROR_OUT_OF_MEMORY;
-        }
+        PL_DHashTableInit(&gHashTable, &pref_HashTableOps,
+                          sizeof(PrefHashEntry), PREF_HASHTABLE_INITIAL_LENGTH);
 
         PL_INIT_ARENA_POOL(&gPrefNameArena, "PrefNameArena",
                            PREFNAME_ARENA_SIZE);
     }
     return NS_OK;
 }
 
 /* Frees the callback list. */
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -397,24 +397,19 @@ nsCacheEntryHashTable::~nsCacheEntryHash
     if (initialized)
         Shutdown();
 }
 
 
 nsresult
 nsCacheEntryHashTable::Init()
 {
-    nsresult rv = NS_OK;
-    initialized = PL_DHashTableInit(&table, &ops,
-                                    sizeof(nsCacheEntryHashTableEntry),
-                                    fallible, 256);
-
-    if (!initialized) rv = NS_ERROR_OUT_OF_MEMORY;
-
-    return rv;
+    PL_DHashTableInit(&table, &ops, sizeof(nsCacheEntryHashTableEntry), 256);
+    initialized = true;
+    return NS_OK;
 }
 
 void
 nsCacheEntryHashTable::Shutdown()
 {
     if (initialized) {
         PL_DHashTableFinish(&table);
         initialized = false;
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -100,20 +100,18 @@ nsHttp::CreateAtomTable()
 
     if (!sLock) {
         sLock = new Mutex("nsHttp.sLock");
     }
 
     // The initial length for this table is a value greater than the number of
     // known atoms (NUM_HTTP_ATOMS) because we expect to encounter a few random
     // headers right off the bat.
-    if (!PL_DHashTableInit(&sAtomTable, &ops, sizeof(PLDHashEntryStub),
-                           fallible, NUM_HTTP_ATOMS + 10)) {
-        return NS_ERROR_OUT_OF_MEMORY;
-    }
+    PL_DHashTableInit(&sAtomTable, &ops, sizeof(PLDHashEntryStub),
+                      NUM_HTTP_ATOMS + 10);
 
     // fill the table with our known atoms
     const char *const atoms[] = {
 #define HTTP_ATOM(_name, _value) nsHttp::_name._val,
 #include "nsHttpAtomList.h"
 #undef HTTP_ATOM
         nullptr
     };
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -78,27 +78,20 @@ static const EntityNode gEntityArray[] =
 #undef HTML_ENTITY
 
 #define NS_HTML_ENTITY_COUNT ((int32_t)ArrayLength(gEntityArray))
 
 nsresult
 nsHTMLEntities::AddRefTable(void)
 {
   if (!gTableRefCnt) {
-    if (!PL_DHashTableInit(&gEntityToUnicode, &EntityToUnicodeOps,
-                           sizeof(EntityNodeEntry),
-                           fallible, NS_HTML_ENTITY_COUNT)) {
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-    if (!PL_DHashTableInit(&gUnicodeToEntity, &UnicodeToEntityOps,
-                           sizeof(EntityNodeEntry),
-                           fallible, NS_HTML_ENTITY_COUNT)) {
-      PL_DHashTableFinish(&gEntityToUnicode);
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
+    PL_DHashTableInit(&gEntityToUnicode, &EntityToUnicodeOps,
+                      sizeof(EntityNodeEntry), NS_HTML_ENTITY_COUNT);
+    PL_DHashTableInit(&gUnicodeToEntity, &UnicodeToEntityOps,
+                      sizeof(EntityNodeEntry), NS_HTML_ENTITY_COUNT);
     for (const EntityNode *node = gEntityArray,
                  *node_end = ArrayEnd(gEntityArray);
          node < node_end; ++node) {
 
       // add to Entity->Unicode table
       EntityNodeEntry* entry =
         static_cast<EntityNodeEntry*>
                    (PL_DHashTableAdd(&gEntityToUnicode, node->mStr, fallible));
--- a/security/manager/ssl/src/nsCertTree.cpp
+++ b/security/manager/ssl/src/nsCertTree.cpp
@@ -170,20 +170,18 @@ void nsCertTree::ClearCompareHash()
   if (mCompareCache.IsInitialized()) {
     PL_DHashTableFinish(&mCompareCache);
   }
 }
 
 nsresult nsCertTree::InitCompareHash()
 {
   ClearCompareHash();
-  if (!PL_DHashTableInit(&mCompareCache, &gMapOps,
-                         sizeof(CompareCacheHashEntryPtr), fallible, 64)) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
+  PL_DHashTableInit(&mCompareCache, &gMapOps,
+                    sizeof(CompareCacheHashEntryPtr), 64);
   return NS_OK;
 }
 
 nsCertTree::~nsCertTree()
 {
   ClearCompareHash();
   delete [] mTreeArray;
 }
--- a/xpcom/ds/nsStaticNameTable.cpp
+++ b/xpcom/ds/nsStaticNameTable.cpp
@@ -133,21 +133,18 @@ nsStaticCaseInsensitiveNameTable::Init(c
   NS_ASSERTION(aLength, "0 length");
 
   mNameArray = (nsDependentCString*)
     moz_xmalloc(aLength * sizeof(nsDependentCString));
   if (!mNameArray) {
     return false;
   }
 
-  if (!PL_DHashTableInit(&mNameTable, &nametable_CaseInsensitiveHashTableOps,
-                         sizeof(NameTableEntry), fallible,
-                         aLength)) {
-    return false;
-  }
+  PL_DHashTableInit(&mNameTable, &nametable_CaseInsensitiveHashTableOps,
+                    sizeof(NameTableEntry), aLength);
 
   for (int32_t index = 0; index < aLength; ++index) {
     const char* raw = aNames[index];
 #ifdef DEBUG
     {
       // verify invariants of contents
       nsAutoCString temp1(raw);
       nsDependentCString temp2(raw);
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -169,20 +169,17 @@ SizeOfEntryStore(uint32_t aCapacity, uin
   return uint64_t(*aNbytes) == nbytes64;   // returns false on overflow
 }
 
 PLDHashTable*
 PL_NewDHashTable(const PLDHashTableOps* aOps, uint32_t aEntrySize,
                  uint32_t aLength)
 {
   PLDHashTable* table = new PLDHashTable();
-  if (!PL_DHashTableInit(table, aOps, aEntrySize, fallible, aLength)) {
-    delete table;
-    return nullptr;
-  }
+  PL_DHashTableInit(table, aOps, aEntrySize, aLength);
   return table;
 }
 
 void
 PL_DHashTableDestroy(PLDHashTable* aTable)
 {
   PL_DHashTableFinish(aTable);
   delete aTable;
@@ -212,87 +209,66 @@ MinLoad(uint32_t aCapacity)
 }
 
 static inline uint32_t
 MinCapacity(uint32_t aLength)
 {
   return (aLength * 4 + (3 - 1)) / 3;   // == ceil(aLength * 4 / 3)
 }
 
-MOZ_ALWAYS_INLINE bool
+MOZ_ALWAYS_INLINE void
 PLDHashTable::Init(const PLDHashTableOps* aOps,
-                   uint32_t aEntrySize, const fallible_t&, uint32_t aLength)
+                   uint32_t aEntrySize, uint32_t aLength)
 {
   MOZ_ASSERT(!IsInitialized());
 
   // Check that the important fields have been set by the constructor.
   MOZ_ASSERT(mOps == nullptr);
   MOZ_ASSERT(mRecursionLevel == 0);
   MOZ_ASSERT(mEntryStore == nullptr);
 
   if (aLength > PL_DHASH_MAX_INITIAL_LENGTH) {
-    return false;
+    MOZ_CRASH("Initial length is too large");
   }
 
   // Compute the smallest capacity allowing |aLength| elements to be inserted
   // without rehashing.
   uint32_t capacity = MinCapacity(aLength);
   if (capacity < PL_DHASH_MIN_CAPACITY) {
     capacity = PL_DHASH_MIN_CAPACITY;
   }
 
   int log2 = CeilingLog2(capacity);
 
   capacity = 1u << log2;
   MOZ_ASSERT(capacity <= PL_DHASH_MAX_CAPACITY);
+  mOps = aOps;
   mHashShift = PL_DHASH_BITS - log2;
   mEntrySize = aEntrySize;
   mEntryCount = mRemovedCount = 0;
   mGeneration = 0;
   uint32_t nbytes;
   if (!SizeOfEntryStore(capacity, aEntrySize, &nbytes)) {
-    return false;  // overflowed
+    MOZ_CRASH("Initial entry store size is too large");
   }
 
   mEntryStore = nullptr;
 
   METER(memset(&mStats, 0, sizeof(mStats)));
 
-  // Set this only once we reach a point where we know we can't fail.
-  mOps = aOps;
-
 #ifdef DEBUG
   mRecursionLevel = 0;
 #endif
-
-  return true;
-}
-
-bool
-PL_DHashTableInit(PLDHashTable* aTable, const PLDHashTableOps* aOps,
-                  uint32_t aEntrySize,
-                  const fallible_t& aFallible, uint32_t aLength)
-{
-  return aTable->Init(aOps, aEntrySize, aFallible, aLength);
 }
 
 void
 PL_DHashTableInit(PLDHashTable* aTable, const PLDHashTableOps* aOps,
                   uint32_t aEntrySize, uint32_t aLength)
 {
-  if (!PL_DHashTableInit(aTable, aOps, aEntrySize, fallible, aLength)) {
-    if (aLength > PL_DHASH_MAX_INITIAL_LENGTH) {
-      MOZ_CRASH();          // the asked-for length was too big
-    }
-    uint32_t capacity = MinCapacity(aLength), nbytes;
-    if (!SizeOfEntryStore(capacity, aEntrySize, &nbytes)) {
-      MOZ_CRASH();          // the required mEntryStore size was too big
-    }
-    NS_ABORT_OOM(nbytes);   // allocation failed
-  }
+  aTable->Init(aOps, aEntrySize, aLength);
 }
 
 /*
  * Double hashing needs the second hash code to be relatively prime to table
  * size, so we simply make hash2 odd.
  */
 #define HASH1(hash0, shift)         ((hash0) >> (shift))
 #define HASH2(hash0,log2,shift)     ((((hash0) << (log2)) >> (shift)) | 1)
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -264,18 +264,17 @@ public:
   {
     return mEntryStore ? CapacityFromHashShift() : 0;
   }
 
   uint32_t EntrySize()  const { return mEntrySize; }
   uint32_t EntryCount() const { return mEntryCount; }
   uint32_t Generation() const { return mGeneration; }
 
-  bool Init(const PLDHashTableOps* aOps, uint32_t aEntrySize,
-            const mozilla::fallible_t&, uint32_t aLength);
+  void Init(const PLDHashTableOps* aOps, uint32_t aEntrySize, uint32_t aLength);
 
   void Finish();
 
   PLDHashEntryHdr* Search(const void* aKey);
   PLDHashEntryHdr* Add(const void* aKey, const mozilla::fallible_t&);
   PLDHashEntryHdr* Add(const void* aKey);
   void Remove(const void* aKey);
 
@@ -462,17 +461,17 @@ 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, initialize it using
- * PL_DHashTableInit, and return its address. Return null on allocation failure.
+ * PL_DHashTableInit, and return its address. Never returns null.
  */
 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->mOps->freeTable). Use this function to destroy a PLDHashTable that
@@ -490,25 +489,16 @@ void PL_DHashTableDestroy(PLDHashTable* 
  *
  * This function will crash if |aEntrySize| and/or |aLength| are too large.
  */
 void PL_DHashTableInit(
   PLDHashTable* aTable, const PLDHashTableOps* aOps,
   uint32_t aEntrySize, uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);
 
 /*
- * Initialize aTable. This is the same as PL_DHashTableInit, except that it
- * returns a boolean indicating success, rather than crashing on failure.
- */
-MOZ_WARN_UNUSED_RESULT bool PL_DHashTableInit(
-  PLDHashTable* aTable, const PLDHashTableOps* aOps,
-  uint32_t aEntrySize, const mozilla::fallible_t&,
-  uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);
-
-/*
  * Free |aTable|'s entry storage (via aTable->mOps->freeTable). Use this
  * function to destroy a PLDHashTable that is allocated on the stack or in
  * static memory and was created via PL_DHashTableInit().
  */
 void PL_DHashTableFinish(PLDHashTable* aTable);
 
 /*
  * To search for a key in |table|, call:
--- a/xpcom/tests/TestPLDHash.cpp
+++ b/xpcom/tests/TestPLDHash.cpp
@@ -17,98 +17,45 @@ static bool test_pldhash_Init_capacity_o
   PLDHashTable t;
 
   // Check that the constructor nulls |ops|.
   if (t.IsInitialized()) {
     return false;
   }
 
   // Try the largest allowed capacity.  With PL_DHASH_MAX_CAPACITY==1<<26, this
-  // will allocate 0.5GB of entry store on 32-bit platforms and 1GB on 64-bit
-  // platforms.
-  if (!PL_DHashTableInit(&t, PL_DHashGetStubOps(), sizeof(PLDHashEntryStub),
-                         mozilla::fallible, PL_DHASH_MAX_INITIAL_LENGTH)) {
-    return false;
-  }
+  // would allocate (if we added an element) 0.5GB of entry store on 32-bit
+  // platforms and 1GB on 64-bit platforms.
+  //
+  // Ideally we'd also try (a) a too-large capacity, and (b) a large capacity
+  // combined with a large entry size that when multipled overflow. But those
+  // cases would cause the test to abort immediately.
+  //
+  // Furthermore, ideally we'd also try a large-but-ok capacity that almost but
+  // doesn't quite overflow, but that would result in allocating just under 4GB
+  // of entry storage.  That's very likely to fail on 32-bit platforms, so such
+  // a test wouldn't be reliable.
+  //
+  PL_DHashTableInit(&t, PL_DHashGetStubOps(), sizeof(PLDHashEntryStub),
+                    PL_DHASH_MAX_INITIAL_LENGTH);
 
   // Check that Init() sets |ops|.
   if (!t.IsInitialized()) {
     return false;
   }
 
   // Check that Finish() nulls |ops|.
   PL_DHashTableFinish(&t);
   if (t.IsInitialized()) {
     return false;
   }
 
   return true;
 }
 
-static bool test_pldhash_Init_capacity_too_large()
-{
-  PLDHashTable t;
-
-  // Check that the constructor nulls |ops|.
-  if (t.IsInitialized()) {
-    return false;
-  }
-
-  // Try the smallest too-large capacity.
-  if (PL_DHashTableInit(&t, PL_DHashGetStubOps(),
-                        sizeof(PLDHashEntryStub),
-                        mozilla::fallible,
-                        PL_DHASH_MAX_INITIAL_LENGTH + 1)) {
-    return false;   // it succeeded!?
-  }
-  // Don't call PL_DHashTableFinish() here; it's not safe after Init() failure.
-
-  // Check that |ops| is still null.
-  if (t.IsInitialized()) {
-    return false;
-  }
-
-  return true;
-}
-
-static bool test_pldhash_Init_overflow()
-{
-  PLDHashTable t;
-
-  // Check that the constructor nulls |ops|.
-  if (t.IsInitialized()) {
-    return false;
-  }
-
-  // Try an acceptable capacity, but one whose byte size overflows uint32_t.
-  //
-  // Ideally we'd also try a large-but-ok capacity that almost but doesn't
-  // quite overflow, but that would result in allocating just under 4GB of
-  // entry storage.  That's very likely to fail on 32-bit platforms, so such a
-  // test wouldn't be reliable.
-
-  struct OneKBEntry {
-      PLDHashEntryHdr hdr;
-      char buf[1024 - sizeof(PLDHashEntryHdr)];
-  };
-
-  if (PL_DHashTableInit(&t, PL_DHashGetStubOps(), sizeof(OneKBEntry),
-                        mozilla::fallible, PL_DHASH_MAX_INITIAL_LENGTH)) {
-    return false;   // it succeeded!?
-  }
-  // Don't call PL_DHashTableFinish() here; it's not safe after Init() failure.
-
-  // Check that |ops| is still null.
-  if (t.IsInitialized()) {
-    return false;
-  }
-
-  return true;
-}
-
 static bool test_pldhash_lazy_storage()
 {
   PLDHashTable t;
   PL_DHashTableInit(&t, PL_DHashGetStubOps(), sizeof(PLDHashEntryStub));
 
   // PLDHashTable allocates entry storage lazily. Check that all the non-add
   // operations work appropriately when the table is empty and the storage
   // hasn't yet been allocated.
@@ -221,18 +168,16 @@ static bool test_pldhash_grow_to_max_cap
 typedef bool (*TestFunc)();
 #define DECL_TEST(name) { #name, name }
 
 static const struct Test {
   const char* name;
   TestFunc    func;
 } tests[] = {
   DECL_TEST(test_pldhash_Init_capacity_ok),
-  DECL_TEST(test_pldhash_Init_capacity_too_large),
-  DECL_TEST(test_pldhash_Init_overflow),
   DECL_TEST(test_pldhash_lazy_storage),
 // See bug 931062, we skip this test on Android due to OOM.
 #ifndef MOZ_WIDGET_ANDROID
   DECL_TEST(test_pldhash_grow_to_max_capacity),
 #endif
   { nullptr, nullptr }
 };