зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1452114 part 1 - Fix GCRuntime::tryNewTenuredThing to report OOM on helper threads as well. r=jonco
--HG-- extra : rebase_source : cb34d5741d697c3fb5cb6dbbdd4f28cb50e3d231
This commit is contained in:
Родитель
4da56c6d15
Коммит
d124a65730
|
@ -244,7 +244,8 @@ GCRuntime::tryNewTenuredThing(JSContext* cx, AllocKind kind, size_t thingSize)
|
|||
// chunks available it may also allocate new memory directly.
|
||||
t = reinterpret_cast<T*>(refillFreeListFromAnyThread(cx, kind));
|
||||
|
||||
if (MOZ_UNLIKELY(!t && allowGC && !cx->helperThread())) {
|
||||
if (MOZ_UNLIKELY(!t && allowGC)) {
|
||||
if (!cx->helperThread()) {
|
||||
// We have no memory available for a new chunk; perform an
|
||||
// all-compartments, non-incremental, shrinking GC and wait for
|
||||
// sweeping to finish.
|
||||
|
@ -253,6 +254,7 @@ GCRuntime::tryNewTenuredThing(JSContext* cx, AllocKind kind, size_t thingSize)
|
|||
cx->runtime()->gc.waitBackgroundSweepOrAllocEnd();
|
||||
|
||||
t = tryNewTenuredThing<T, NoGC>(cx, kind, thingSize);
|
||||
}
|
||||
if (!t)
|
||||
ReportOutOfMemory(cx);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче