Don't attempt to GC when caller has waived the GC heap quote (528507, r=dvander).

This commit is contained in:
Andreas Gal 2009-11-17 14:31:06 -08:00
parent 02f032b9bb
commit f391d8a4f0

View File

@ -1441,7 +1441,7 @@ RefillFinalizableFreeList(JSContext *cx, unsigned thingKind)
} }
METER(JSGCArenaStats *astats = &cx->runtime->gcStats.arenaStats[thingKind]); METER(JSGCArenaStats *astats = &cx->runtime->gcStats.arenaStats[thingKind]);
bool canGC = !JS_ON_TRACE(cx); bool canGC = !JS_ON_TRACE(cx) && !JS_THREAD_DATA(cx)->waiveGCQuota;
bool doGC = canGC && IsGCThresholdReached(rt); bool doGC = canGC && IsGCThresholdReached(rt);
JSGCArenaList *arenaList = &rt->gcArenaList[thingKind]; JSGCArenaList *arenaList = &rt->gcArenaList[thingKind];
JSGCArenaInfo *a; JSGCArenaInfo *a;
@ -1678,7 +1678,7 @@ RefillDoubleFreeList(JSContext *cx)
JS_LOCK_GC(rt); JS_LOCK_GC(rt);
JSGCArenaInfo *a; JSGCArenaInfo *a;
bool canGC = !JS_ON_TRACE(cx); bool canGC = !JS_ON_TRACE(cx) && !JS_THREAD_DATA(cx)->waiveGCQuota;
bool doGC = canGC && IsGCThresholdReached(rt); bool doGC = canGC && IsGCThresholdReached(rt);
for (;;) { for (;;) {
if (doGC) { if (doGC) {