summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Leeds <randall@apache.org>2013-05-14 17:34:40 -0700
committerRandall Leeds <randall@apache.org>2013-05-15 15:16:39 -0700
commit501459c8b70efb814f5eef131201f7954781af1d (patch)
treee8accf9c05ad5292c3752eb03e1175f15dca66d8
parenta71fc206d9480bf13321bd280341ab9460cc3919 (diff)
downloadcouchdb-501459c8b70efb814f5eef131201f7954781af1d.tar.gz
[couchjs] make stack size option effective
The previous way this was coded changes the chunk size that is used whenever the stack grows but does not change the maximum memory allowed by the runtime. Closes COUCHDB-1792
-rw-r--r--src/couchdb/priv/couch_js/help.h4
-rw-r--r--src/couchdb/priv/couch_js/sm170.c6
-rw-r--r--src/couchdb/priv/couch_js/sm180.c6
-rw-r--r--src/couchdb/priv/couch_js/sm185.c4
-rw-r--r--src/couchdb/priv/couch_js/util.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/couchdb/priv/couch_js/help.h b/src/couchdb/priv/couch_js/help.h
index b31bb8c0a..f4ddb24af 100644
--- a/src/couchdb/priv/couch_js/help.h
+++ b/src/couchdb/priv/couch_js/help.h
@@ -48,8 +48,8 @@ static const char USAGE_TEMPLATE[] =
" -V display version information and exit\n"
" -H enable %s cURL bindings (only avaiable\n"
" if package was built with cURL available)\n"
- " -S SIZE specify that the interpreter should set the\n"
- " stack quota for JS contexts to SIZE bytes\n"
+ " -S SIZE specify that the runtime should allow at\n"
+ " most SIZE bytes of memory to be allocated\n"
" -u FILE path to a .uri file containing the address\n"
" (or addresses) of one or more servers\n"
"\n"
diff --git a/src/couchdb/priv/couch_js/sm170.c b/src/couchdb/priv/couch_js/sm170.c
index 4a18d8fee..51e4f4d4e 100644
--- a/src/couchdb/priv/couch_js/sm170.c
+++ b/src/couchdb/priv/couch_js/sm170.c
@@ -313,12 +313,12 @@ main(int argc, const char* argv[])
int i;
couch_args* args = couch_parse_args(argc, argv);
-
- rt = JS_NewRuntime(64L * 1024L * 1024L);
+
+ rt = JS_NewRuntime(args->stack_size);
if(rt == NULL)
return 1;
- cx = JS_NewContext(rt, args->stack_size);
+ cx = JS_NewContext(rt, 8L * 1024L);
if(cx == NULL)
return 1;
diff --git a/src/couchdb/priv/couch_js/sm180.c b/src/couchdb/priv/couch_js/sm180.c
index 9ffd1df64..5fb8ce0ac 100644
--- a/src/couchdb/priv/couch_js/sm180.c
+++ b/src/couchdb/priv/couch_js/sm180.c
@@ -322,12 +322,12 @@ main(int argc, const char* argv[])
int i;
couch_args* args = couch_parse_args(argc, argv);
-
- rt = JS_NewRuntime(64L * 1024L * 1024L);
+
+ rt = JS_NewRuntime(args->stack_size);
if(rt == NULL)
return 1;
- cx = JS_NewContext(rt, args->stack_size);
+ cx = JS_NewContext(rt, 8L * 1024L);
if(cx == NULL)
return 1;
diff --git a/src/couchdb/priv/couch_js/sm185.c b/src/couchdb/priv/couch_js/sm185.c
index bfee023c0..c378d4aa1 100644
--- a/src/couchdb/priv/couch_js/sm185.c
+++ b/src/couchdb/priv/couch_js/sm185.c
@@ -335,11 +335,11 @@ main(int argc, const char* argv[])
couch_args* args = couch_parse_args(argc, argv);
- rt = JS_NewRuntime(64L * 1024L * 1024L);
+ rt = JS_NewRuntime(args->stack_size);
if(rt == NULL)
return 1;
- cx = JS_NewContext(rt, args->stack_size);
+ cx = JS_NewContext(rt, 8L * 1024L);
if(cx == NULL)
return 1;
diff --git a/src/couchdb/priv/couch_js/util.c b/src/couchdb/priv/couch_js/util.c
index 5c88402e2..b4700de6f 100644
--- a/src/couchdb/priv/couch_js/util.c
+++ b/src/couchdb/priv/couch_js/util.c
@@ -77,7 +77,7 @@ couch_parse_args(int argc, const char* argv[])
return NULL;
memset(args, '\0', sizeof(couch_args));
- args->stack_size = 8L * 1024L;
+ args->stack_size = 64L * 1024L * 1024L;
while(i < argc) {
if(strcmp("-h", argv[i]) == 0) {