aboutsummaryrefslogtreecommitdiffstats
path: root/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/execute.c b/execute.c
index 4703110..b41541a 100644
--- a/execute.c
+++ b/execute.c
@@ -261,7 +261,7 @@ unwind_stack(Finally_Reason why, Var value, enum outcome *outcome)
bi_func_data = a->bi_func_data;
}
player = a->player;
- free_activation(*a, 0); /* 0 == don't free bi_func_data */
+ free_activation(a, 0); /* 0 == don't free bi_func_data */
if (top_activ_stack == 0) { /* done */
if (outcome)
@@ -341,7 +341,7 @@ unwind_stack(Finally_Reason why, Var value, enum outcome *outcome)
case BI_KILL:
break;
case BI_CALL:
- free_activation(activ_stack[top_activ_stack--], 0);
+ free_activation(&activ_stack[top_activ_stack--], 0);
bi_func_pc = p.u.call.pc;
bi_func_data = p.u.call.data;
break;
@@ -511,23 +511,23 @@ push_activation(void)
}
void
-free_activation(activation a, char data_too)
+free_activation(activation *ap, char data_too)
{
Var *i;
- free_rt_env(a.rt_env, a.prog->num_var_names);
+ free_rt_env(ap->rt_env, ap->prog->num_var_names);
- for (i = a.base_rt_stack; i < a.top_rt_stack; i++)
+ for (i = ap->base_rt_stack; i < ap->top_rt_stack; i++)
free_var(*i);
- free_rt_stack(&a);
- free_var(a.temp);
- free_str(a.verb);
- free_str(a.verbname);
+ free_rt_stack(ap);
+ free_var(ap->temp);
+ free_str(ap->verb);
+ free_str(ap->verbname);
- free_program(a.prog);
+ free_program(ap->prog);
- if (data_too && a.bi_func_pc && a.bi_func_data)
- free_data(a.bi_func_data);
+ if (data_too && ap->bi_func_pc && ap->bi_func_data)
+ free_data(ap->bi_func_data);
/* else bi_func_state will be later freed by bi_function */
}
@@ -2878,6 +2878,10 @@ char rcsid_execute[] = "$Id$";
/*
* $Log$
+ * Revision 1.13 2002/08/18 09:47:26 bjj
+ * Finally made free_activation() take a pointer after noticing how !$%^&
+ * much time it was taking in a particular profiling run.
+ *
* Revision 1.12 2001/03/12 05:10:54 bjj
* Split out call_verb and call_verb2. The latter must only be called with
* strings that are already MOO strings (str_ref-able).