aboutsummaryrefslogtreecommitdiffstats
path: root/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'program.c')
-rw-r--r--program.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/program.c b/program.c
index d3d752f..24ae610 100644
--- a/program.c
+++ b/program.c
@@ -78,7 +78,7 @@ program_bytes(Program * p)
count += sizeof(const char *) * p->num_var_names;
for (i = 0; i < p->num_var_names; i++)
- count += strlen(p->var_names[i]) + 1;
+ count += memo_strlen(p->var_names[i]) + 1;
return count;
}
@@ -116,6 +116,13 @@ char rcsid_program[] = "$Id$";
/*
* $Log$
+ * Revision 1.6 2006/09/07 00:55:02 bjj
+ * Add new MEMO_STRLEN option which uses the refcounting mechanism to
+ * store strlen with strings. This is basically free, since most string
+ * allocations are rounded up by malloc anyway. This saves lots of cycles
+ * computing strlen. (The change is originally from jitmoo, where I wanted
+ * inline range checks for string ops).
+ *
* Revision 1.5 1998/12/14 13:18:48 nop
* Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
*