зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1268024: Force triggering a GC after creating a mmapped array; r=luke
MozReview-Commit-ID: 1tRLdOhVqBx --HG-- extra : rebase_source : 55a0089fcb056c002a1c2f8dd9d16d74298fd15e
This commit is contained in:
Родитель
a61eb3acbb
Коммит
3ce0700825
|
@ -462,7 +462,7 @@ ArrayBufferObject::createForWasm(JSContext* cx, uint32_t numBytes, bool signalsF
|
|||
#endif
|
||||
}
|
||||
|
||||
auto buffer = ArrayBufferObject::create(cx, numBytes);
|
||||
auto* buffer = ArrayBufferObject::create(cx, numBytes);
|
||||
if (!buffer)
|
||||
return nullptr;
|
||||
|
||||
|
@ -633,6 +633,10 @@ ArrayBufferObject::create(JSContext* cx, uint32_t nbytes, BufferContents content
|
|||
size_t nAllocated = nbytes;
|
||||
if (contents.kind() == MAPPED)
|
||||
nAllocated = JS_ROUNDUP(nbytes, js::gc::SystemPageSize());
|
||||
#ifdef ASMJS_MAY_USE_SIGNAL_HANDLERS_FOR_OOB
|
||||
else if (contents.kind() == WASM_MAPPED)
|
||||
nAllocated = wasm::MappedSize;
|
||||
#endif
|
||||
cx->zone()->updateMallocCounter(nAllocated);
|
||||
}
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче