зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1023035 - Improve checking for whether we are on the main thread when triggering malloc GCs, r=billm.
This commit is contained in:
Родитель
c30e9aef10
Коммит
a184af95d5
|
@ -2145,12 +2145,17 @@ GCRuntime::triggerGC(JS::gcreason::Reason reason)
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't trigger GCs if this is being called off the main thread from
|
||||
* onTooMuchMalloc().
|
||||
*/
|
||||
if (!CurrentThreadCanAccessRuntime(rt))
|
||||
return false;
|
||||
|
||||
/* Don't trigger GCs when allocating under the interrupt callback lock. */
|
||||
if (rt->currentThreadOwnsInterruptLock())
|
||||
return false;
|
||||
|
||||
JS_ASSERT(CurrentThreadCanAccessRuntime(rt));
|
||||
|
||||
/* GC is already running. */
|
||||
if (rt->isHeapCollecting())
|
||||
return false;
|
||||
|
|
|
@ -710,8 +710,6 @@ JSRuntime::updateMallocCounter(JS::Zone *zone, size_t nbytes)
|
|||
JS_FRIEND_API(void)
|
||||
JSRuntime::onTooMuchMalloc()
|
||||
{
|
||||
if (!CurrentThreadCanAccessRuntime(this))
|
||||
return;
|
||||
gc.onTooMuchMalloc();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче