Bug 630947, run GC more often before CC, r=gal, a=blocker

This commit is contained in:
Olli Pettay 2011-02-08 11:43:56 +02:00
Родитель 67623f003b
Коммит 1d09aef75d
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -261,7 +261,7 @@ nsUserActivityObserver::Observe(nsISupports* aSubject, const char* aTopic,
if (sUserIsActive) {
sUserIsActive = PR_FALSE;
if (!sGCTimer) {
nsJSContext::MaybeCC(PR_FALSE);
nsJSContext::MaybeCC(PR_FALSE, PR_TRUE);
return NS_OK;
}
}
@ -3430,7 +3430,7 @@ nsJSContext::CC(nsICycleCollectorListener *aListener, PRBool aForceGC)
//static
PRBool
nsJSContext::MaybeCC(PRBool aHigherProbability)
nsJSContext::MaybeCC(PRBool aHigherProbability, PRBool aForceGC)
{
++sDelayedCCollectCount;
@ -3473,7 +3473,7 @@ nsJSContext::MaybeCC(PRBool aHigherProbability)
((sCCSuspectChanges > NS_MIN_SUSPECT_CHANGES &&
GetGCRunsSinceLastCC() > NS_MAX_GC_COUNT) ||
(sCCSuspectChanges > NS_MAX_SUSPECT_CHANGES))) {
return IntervalCC();
return IntervalCC(aForceGC);
}
return PR_FALSE;
}
@ -3483,7 +3483,7 @@ void
nsJSContext::CCIfUserInactive()
{
if (sUserIsActive) {
MaybeCC(PR_TRUE);
MaybeCC(PR_TRUE, PR_TRUE);
} else {
IntervalCC(PR_TRUE);
}

Просмотреть файл

@ -205,14 +205,14 @@ public:
// If the previous call to cycle collector did collect something,
// MaybeCC works effectively as if aHigherProbability was true.
// @return PR_TRUE if cycle collector was called.
static PRBool MaybeCC(PRBool aHigherProbability);
static PRBool MaybeCC(PRBool aHigherProbability, PRBool aForceGC = PR_FALSE);
// IntervalCC() calls CC() if at least NS_MIN_CC_INTERVAL milliseconds have
// elapsed since the previous cycle collector call.
static PRBool IntervalCC(PRBool aForceGC = PR_FALSE);
// Calls IntervalCC(PR_TRUE) if user is currently inactive,
// otherwise MaybeCC(PR_TRUE)
// otherwise MaybeCC(PR_TRUE, PR_TRUE)
static void CCIfUserInactive();
static void MaybeCCIfUserInactive();