Bug 664257 - Clean up dead initialization found by clang analyzer (r=lhansen)
authorTommy Reilly <treilly@adobe.com>
Wed, 29 Jun 2011 09:21:31 -0400
changeset 6436 97c56359f161
parent 6435 958f979a948d
child 6437 4d448a44169a
push id3786
push usertreilly@adobe.com
push date2011-06-29 13:21 +0000
reviewerslhansen
bugs664257
Bug 664257 - Clean up dead initialization found by clang analyzer (r=lhansen)
MMgc/GCHeap.cpp
--- a/MMgc/GCHeap.cpp
+++ b/MMgc/GCHeap.cpp
@@ -2929,31 +2929,30 @@ namespace MMgc
         //  the heap to normal before continuing.
 
         if (statusNotificationBeingSent() || status != kMemNormal || !m_oomHandling)
             return;
 
         m_notificationThread = VMPI_currentThread();
 
         size_t startingTotal = GetTotalHeapSize() + externalPressure / kBlockSize;
-        size_t currentTotal = startingTotal;
 
         BasicListIterator<OOMCallback*> iter(callbacks);
         OOMCallback *cb = NULL;
         bool bContinue = true;
         do {
             cb = iter.next();
             if(cb)
             {
                 VMPI_lockRelease(&m_spinlock);
                 cb->memoryStatusChange(kFreeMemoryIfPossible, kFreeMemoryIfPossible);
                 VMPI_lockAcquire(&m_spinlock);
 
                 Decommit();
-                currentTotal = GetTotalHeapSize() + externalPressure / kBlockSize;
+                size_t currentTotal = GetTotalHeapSize() + externalPressure / kBlockSize;
 
                 //  If we've freed MORE than the minimum amount, we can stop freeing
                 if ((startingTotal - currentTotal) > minimumBlocksToFree)
                 {
                     bContinue = false;
                 }
             }
         } while(cb != NULL && bContinue);