summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-24 19:42:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-24 19:42:30 -0700
commit329318ae4f9c180ed68ec484bb5e1acdcb3dec44 (patch)
tree043acc3234d4656923e383ddf819506af58ba15a
parent869c570ea8231596b374fd8fa62b6646d61f234e (diff)
downloadtxr-329318ae4f9c180ed68ec484bb5e1acdcb3dec44.tar.gz
txr-329318ae4f9c180ed68ec484bb5e1acdcb3dec44.tar.bz2
txr-329318ae4f9c180ed68ec484bb5e1acdcb3dec44.zip
Reduce stack usage for args in a few places.
* eval.c (apply, do_eval): Use ARGS_MIN instead of ARGS_MAX. * unwind.c (uw_throw): Ditto, when invoking handler.
-rw-r--r--eval.c5
-rw-r--r--unwind.c3
2 files changed, 3 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index 84e1265a..ea08c7b3 100644
--- a/eval.c
+++ b/eval.c
@@ -678,8 +678,7 @@ static val get_param_syms(val params)
val apply(val fun, val arglist, val ctx_form)
{
- args_decl(args, ARGS_MAX);
- args_init_list(args, ARGS_MAX, arglist);
+ args_decl_list(args, ARGS_MIN, arglist);
return generic_funcall(fun, args);
}
@@ -1003,7 +1002,7 @@ static val do_eval(val form, val env, val ctx_form,
} else {
val arglist = rest(form);
cnum alen = if3(consp(arglist), c_num(length(arglist)), 0);
- cnum argc = max(alen, ARGS_MAX);
+ cnum argc = max(alen, ARGS_MIN);
val ret, lfe_save = last_form_evaled;
args_decl(args, argc);
diff --git a/unwind.c b/unwind.c
index a8df8914..79b9a7fd 100644
--- a/unwind.c
+++ b/unwind.c
@@ -425,8 +425,7 @@ val uw_throw(val sym, val args)
if (uw_exception_subtype_p(sym, car(match)))
break;
if (match) {
- args_decl(gf_args, ARGS_MAX);
- args_init_list(gf_args, ARGS_MAX, cons(sym, args));
+ args_decl_list(gf_args, ARGS_MIN, cons(sym, args));
--reentry_count;
invoke_handler(ex, gf_args);
++reentry_count;