зеркало из https://github.com/mozilla/gecko-dev.git
Bug 885908 - use js_malloc instead cx->malloc inside ScriptSource::chars to avoid triggering GCs for large scripts (r=billm)
--HG-- extra : rebase_source : 87e4669be579cb7b9f836856e1bfb4bfcd0e6669
This commit is contained in:
Родитель
927915b3cb
Коммит
9c55104e5e
|
@ -1249,7 +1249,7 @@ ScriptSource::chars(JSContext *cx)
|
|||
JSStableString *cached = cx->runtime()->sourceDataCache.lookup(this);
|
||||
if (!cached) {
|
||||
const size_t nbytes = sizeof(jschar) * (length_ + 1);
|
||||
jschar *decompressed = static_cast<jschar *>(cx->malloc_(nbytes));
|
||||
jschar *decompressed = static_cast<jschar *>(js_malloc(nbytes));
|
||||
if (!decompressed)
|
||||
return NULL;
|
||||
if (!DecompressString(data.compressed, compressedLength_,
|
||||
|
|
Загрузка…
Ссылка в новой задаче