diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index e07fbf363b3e..8dba82bcb33e 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -1064,15 +1064,8 @@ public: void InitBlocks() { mCount = 0; - mFreeList = nullptr; - StartBlock(&mFirstBlock); - } - - void StartBlock(PurpleBlock* aBlock) - { - MOZ_ASSERT(!mFreeList, "should not have free list"); - mFreeList = aBlock->mEntries; - aBlock->InitNextPointers(); + mFreeList = mFirstBlock.mEntries; + mFirstBlock.InitNextPointers(); } void FreeBlocks() @@ -1130,7 +1123,8 @@ public: { if (MOZ_UNLIKELY(!mFreeList)) { PurpleBlock* b = new PurpleBlock; - StartBlock(b); + mFreeList = b->mEntries; + b->InitNextPointers(); // Add the new block as the second block in the list. b->mNext = mFirstBlock.mNext;