backout patch for Bug 373462, Bug 385322

git-svn-id: svn://10.0.0.236/trunk@236434 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Olli.Pettay%helsinki.fi
2007-09-21 10:00:48 +00:00
parent 7b90bd1aa0
commit f316d5eeb5
6 changed files with 18 additions and 262 deletions

View File

@@ -869,7 +869,7 @@ struct nsCycleCollector
PRBool Forget(nsISupports *n);
void Allocated(void *n, size_t sz);
void Freed(void *n);
PRBool Collect(PRUint32 aTryCollections = 1);
void Collect(PRUint32 aTryCollections = 1);
void Shutdown();
#ifdef DEBUG_CC
@@ -2021,10 +2021,9 @@ nsCycleCollector::Freed(void *n)
}
#endif
PRBool
void
nsCycleCollector::Collect(PRUint32 aTryCollections)
{
PRBool didCollect = PR_FALSE;
#if defined(DEBUG_CC) && !defined(__MINGW32__)
if (!mParams.mDoNothing && mParams.mHookMalloc)
InitMemHook();
@@ -2032,7 +2031,7 @@ nsCycleCollector::Collect(PRUint32 aTryCollections)
// This can legitimately happen in a few cases. See bug 383651.
if (mCollectionInProgress)
return didCollect;
return;
#ifdef COLLECT_TIME_DEBUG
printf("cc: Starting nsCycleCollector::Collect(%d)\n", aTryCollections);
@@ -2169,11 +2168,8 @@ nsCycleCollector::Collect(PRUint32 aTryCollections)
// mBuf.GetSize() == 0 check above), we should stop
// repeating collections if we didn't collect anything
// this time.
if (!collected) {
if (!collected)
aTryCollections = 0;
} else {
didCollect = PR_TRUE;
}
}
#ifdef DEBUG_CC
@@ -2198,7 +2194,6 @@ nsCycleCollector::Collect(PRUint32 aTryCollections)
#ifdef DEBUG_CC
ExplainLiveExpectedGarbage();
#endif
return didCollect;
}
void
@@ -2599,10 +2594,11 @@ NS_CycleCollectorForget(nsISupports *n)
}
PRBool
void
nsCycleCollector_collect()
{
return sCollector ? sCollector->Collect() : PR_FALSE;
if (sCollector)
sCollector->Collect();
}
nsresult