Bug 1547977 - Use JS::DefaultHeapMaxBytes instead of 4 MB for PAC runtime. r=jonco,mayhemer

DefaultHeapMaxBytes is currently 32 MB so it should give us a bit more breathing
room.

Differential Revision: https://phabricator.services.mozilla.com/D42819

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan de Mooij 2019-08-21 15:21:40 +00:00
Родитель 2183a1dea8
Коммит 28c7a3ddb9
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -562,7 +562,7 @@ static const JSFunctionSpec PACGlobalFunctions[] = {
class JSContextWrapper { class JSContextWrapper {
public: public:
static JSContextWrapper* Create(uint32_t aExtraHeapSize) { static JSContextWrapper* Create(uint32_t aExtraHeapSize) {
JSContext* cx = JS_NewContext(sContextHeapSize + aExtraHeapSize); JSContext* cx = JS_NewContext(JS::DefaultHeapMaxBytes + aExtraHeapSize);
if (NS_WARN_IF(!cx)) return nullptr; if (NS_WARN_IF(!cx)) return nullptr;
JSContextWrapper* entry = new JSContextWrapper(cx); JSContextWrapper* entry = new JSContextWrapper(cx);
@ -593,8 +593,6 @@ class JSContextWrapper {
bool IsOK() { return mOK; } bool IsOK() { return mOK; }
private: private:
static const uint32_t sContextHeapSize = 4 << 20; // 4 MB
JSContext* mContext; JSContext* mContext;
JS::PersistentRooted<JSObject*> mGlobal; JS::PersistentRooted<JSObject*> mGlobal;
bool mOK; bool mOK;