From 5eefb4ade649a5b481bc7554cb7141faaceea9d2 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Thu, 1 Dec 2011 10:00:06 -0600 Subject: Set the stack size for sub contexts I was forgetting to pass the args through to evalcx so that it could use the stack size specified on the command line. --- couchjs/c_src/sm180.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'couchjs/c_src/sm180.c') diff --git a/couchjs/c_src/sm180.c b/couchjs/c_src/sm180.c index 7dc2a974..6c33345f 100644 --- a/couchjs/c_src/sm180.c +++ b/couchjs/c_src/sm180.c @@ -127,12 +127,14 @@ evalcx(JSContext *cx, uintN argc, jsval* vp) jsval rval; JSBool ret = JS_FALSE; + couch_args* args = (couch_args*) JS_GetContextPrivate(cx); + sandbox = NULL; if(!JS_ConvertArguments(cx, argc, argv, "S / o", &str, &sandbox)) { return JS_FALSE; } - subcx = JS_NewContext(JS_GetRuntime(cx), 8L * 1024L); + subcx = JS_NewContext(JS_GetRuntime(cx), args->stack_size); if(!subcx) { JS_ReportOutOfMemory(cx); return JS_FALSE; @@ -315,6 +317,7 @@ main(int argc, const char* argv[]) if(cx == NULL) return 1; + JS_SetContextPrivate(cx, args); JS_SetErrorReporter(cx, couch_error); JS_ToggleOptions(cx, JSOPTION_XML); -- cgit v1.2.3