From 28c7a3ddb9a3176b5af8a3d97cb130d2d5a9167d Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Wed, 21 Aug 2019 15:21:40 +0000 Subject: [PATCH] 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 --- netwerk/base/ProxyAutoConfig.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp index 8e88fadd664f..0c926b252b15 100644 --- a/netwerk/base/ProxyAutoConfig.cpp +++ b/netwerk/base/ProxyAutoConfig.cpp @@ -562,7 +562,7 @@ static const JSFunctionSpec PACGlobalFunctions[] = { class JSContextWrapper { public: 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; JSContextWrapper* entry = new JSContextWrapper(cx); @@ -593,8 +593,6 @@ class JSContextWrapper { bool IsOK() { return mOK; } private: - static const uint32_t sContextHeapSize = 4 << 20; // 4 MB - JSContext* mContext; JS::PersistentRooted mGlobal; bool mOK;