Bug 936236 - Wait on background sweeping to complete after large-allocation-failure callback (r=jonco)

--HG--
extra : rebase_source : a93e691cbd76995abfa4ceed709c495fdb97d62c
This commit is contained in:
Luke Wagner 2014-02-14 12:25:04 -06:00
parent 5864b3d72e
commit e7f39fa9fe

View File

@ -1726,7 +1726,7 @@ struct JSRuntime : public JS::shadow::Runtime,
if (!largeAllocationFailureCallback || bytes < LARGE_ALLOCATION)
return nullptr;
largeAllocationFailureCallback();
return js_calloc(bytes);
return onOutOfMemory(reinterpret_cast<void *>(1), bytes);
}
void *reallocCanGC(void *p, size_t bytes) {
@ -1736,7 +1736,7 @@ struct JSRuntime : public JS::shadow::Runtime,
if (!largeAllocationFailureCallback || bytes < LARGE_ALLOCATION)
return nullptr;
largeAllocationFailureCallback();
return js_realloc(p, bytes);
return onOutOfMemory(p, bytes);
}
};