summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbjj <bjj>2002-08-18 09:47:26 (GMT)
committerbjj <bjj>2002-08-18 09:47:26 (GMT)
commit3303d4ae13eb509a99bf1d72fb59ff052c42aae7 (patch)
tree77144d11e018fdefa38280d969453c790b519629
parent08859785b511e4c6f6197590e051ad399d830ae4 (diff)
downloadmoo-3303d4ae13eb509a99bf1d72fb59ff052c42aae7.zip
moo-3303d4ae13eb509a99bf1d72fb59ff052c42aae7.tar.gz
moo-3303d4ae13eb509a99bf1d72fb59ff052c42aae7.tar.bz2
moo-3303d4ae13eb509a99bf1d72fb59ff052c42aae7.tar.xz
Finally made free_activation() take a pointer after noticing how !$%^&FLOATSUSPEND.ROOT
much time it was taking in a particular profiling run.
-rw-r--r--eval_vm.c6
-rw-r--r--execute.c28
-rw-r--r--execute.h6
-rw-r--r--utils.c11
4 files changed, 32 insertions, 19 deletions
diff --git a/eval_vm.c b/eval_vm.c
index 1a7af65..8db69f8 100644
--- a/eval_vm.c
+++ b/eval_vm.c
@@ -46,7 +46,7 @@ free_vm(vm the_vm, int stack_too)
if (stack_too)
for (i = the_vm->top_activ_stack; i >= 0; i--)
- free_activation(the_vm->activ_stack[i], 1);
+ free_activation(&the_vm->activ_stack[i], 1);
myfree(the_vm->activ_stack, M_VM);
myfree(the_vm, M_VM);
}
@@ -124,6 +124,10 @@ char rcsid_eval_vm[] = "$Id$";
/*
* $Log$
+ * Revision 1.4 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.3 1998/12/14 13:17:46 nop
* Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
*
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).
diff --git a/execute.h b/execute.h
index 9b9d4f6..2cd6fb7 100644
--- a/execute.h
+++ b/execute.h
@@ -55,7 +55,7 @@ typedef struct {
int debug;
} activation;
-extern void free_activation(activation a, char data_too);
+extern void free_activation(activation *, char data_too);
typedef struct {
int task_id;
@@ -135,6 +135,10 @@ extern int read_activ(activation * a, int which_vector);
/*
* $Log$
+ * Revision 1.6 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.5 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).
diff --git a/utils.c b/utils.c
index 46ab6a9..98b90a8 100644
--- a/utils.c
+++ b/utils.c
@@ -60,10 +60,10 @@ static const char cmap[] =
int
mystrcasecmp(const char *ss, const char *tt)
{
- const unsigned char *s = (const unsigned char *) ss;
- const unsigned char *t = (const unsigned char *) tt;
+ register const unsigned char *s = (const unsigned char *) ss;
+ register const unsigned char *t = (const unsigned char *) tt;
- if (ss == tt) {
+ if (s == t) {
return 0;
}
while (cmap[*s] == cmap[*t++]) {
@@ -443,8 +443,9 @@ char rcsid_utils[] = "$Id$";
/*
* $Log$
- * Revision 1.6 2002/08/18 08:51:50 bjj
- * Faster and better (?) hash function. Yes it really was slow.
+ * Revision 1.7 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.5 1999/08/09 02:36:33 nop
* Shortcut various equality tests if we have pointer equality.