Bug 716014, use compartment gc more often, JS API part, r=terrence

--HG--
extra : rebase_source : c61a7552611cfbb0ce39bfee7787da57bec5a637
This commit is contained in:
wmccloskey@mozilla.com 2012-05-05 11:56:58 +03:00
Родитель d7fa29d6cf
Коммит 03b9baceb0
2 изменённых файлов: 14 добавлений и 0 удалений

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

@ -144,6 +144,17 @@ js::PrepareForFullGC(JSRuntime *rt)
c->scheduleGC(); c->scheduleGC();
} }
JS_FRIEND_API(bool)
js::IsGCScheduled(JSRuntime *rt)
{
for (CompartmentsIter c(rt); !c.done(); c.next()) {
if (c->isGCScheduled())
return true;
}
return false;
}
JS_FRIEND_API(void) JS_FRIEND_API(void)
js::GCForReason(JSRuntime *rt, gcreason::Reason reason) js::GCForReason(JSRuntime *rt, gcreason::Reason reason)
{ {

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

@ -651,6 +651,9 @@ PrepareCompartmentForGC(JSCompartment *comp);
extern JS_FRIEND_API(void) extern JS_FRIEND_API(void)
PrepareForFullGC(JSRuntime *rt); PrepareForFullGC(JSRuntime *rt);
extern JS_FRIEND_API(bool)
IsGCScheduled(JSRuntime *rt);
/* /*
* When triggering a GC using one of the functions below, it is first necessary * When triggering a GC using one of the functions below, it is first necessary
* to select the compartments to be collected. To do this, you can call * to select the compartments to be collected. To do this, you can call