Bug 878000 - ProxyAutoConfig should set a stack quotum when creating a JS runtime
authorEddy Bruel <ejpbruel@mozilla.com>
Fri, 31 May 2013 20:20:30 -0700
changeset 140805 1180fa46316f9c7c136c3d4d73aab5a37e8f4e54
parent 140804 466760822586c99d76a02764dad8931d5b6b7343
child 140806 439b8967c5ae645648f5dd5a31692d70bd4f3d20
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs878000
milestone24.0a1
Bug 878000 - ProxyAutoConfig should set a stack quotum when creating a JS runtime
netwerk/base/src/ProxyAutoConfig.cpp
--- a/netwerk/base/src/ProxyAutoConfig.cpp
+++ b/netwerk/base/src/ProxyAutoConfig.cpp
@@ -520,16 +520,22 @@ private:
       MOZ_COUNT_CTOR(JSRuntimeWrapper);
   }
 
   nsresult Init()
   {
     mRuntime = JS_NewRuntime(sRuntimeHeapSize, JS_NO_HELPER_THREADS);
     NS_ENSURE_TRUE(mRuntime, NS_ERROR_OUT_OF_MEMORY);
 
+    /*
+     * Not setting this will cause JS_CHECK_RECURSION to report false
+     * positives
+     */ 
+    JS_SetNativeStackQuota(mRuntime, 128 * sizeof(size_t) * 1024); 
+
     mContext = JS_NewContext(mRuntime, 0);
     NS_ENSURE_TRUE(mContext, NS_ERROR_OUT_OF_MEMORY);
 
     JSAutoRequest ar(mContext);
 
     mGlobal = JS_NewGlobalObject(mContext, &sGlobalClass, nullptr, JS::SystemZone);
     NS_ENSURE_TRUE(mGlobal, NS_ERROR_OUT_OF_MEMORY);