[gjs] Increase the "script stack quota"
- From: Johan Bilien <jobi src gnome org>
- To: svn-commits-list gnome org
- Subject: [gjs] Increase the "script stack quota"
- Date: Mon, 4 May 2009 13:04:35 -0400 (EDT)
commit 72b6b249236c9ab27e110dab031ec0f2888458c7
Author: Johan Bilien <jobi litl com>
Date: Mon May 4 09:55:12 2009 +0100
Increase the "script stack quota"
http://bugzilla.gnome.org/show_bug.cgi?id=581277
Parsing some long strings as JSON sometimes lead to "script stack space
quota is exhausted" errors. Discussions at
https://bugzilla.mozilla.org/show_bug.cgi?id=420869 show that firefox
when faced with the same problem increased the script stack quota on its
contexts.
Firefox sets this to 100MB, I think we should also increase it from the
default. 100MB seems to fix the error case at hand.
---
gjs/context.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gjs/context.c b/gjs/context.c
index b121a1b..5e500b0 100644
--- a/gjs/context.c
+++ b/gjs/context.c
@@ -330,6 +330,10 @@ gjs_context_constructor (GType type,
if (js_context->context == NULL)
gjs_fatal("Failed to create javascript context");
+ /* same as firefox, see discussion at
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=420869 */
+ JS_SetScriptStackQuota(js_context->context, 100*1024*1024);
+
/* JSOPTION_DONT_REPORT_UNCAUGHT: Don't send exceptions to our
* error report handler; instead leave them set. This allows us
* to get at the exception object.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]