cvsuser 04/05/08 06:54:15
Modified: src list.c
Log:
speed up list_mark by 10%
Revision Changes Path
1.47 +8 -7 parrot/src/list.c
Index: list.c
===================================================================
RCS file: /cvs/public/parrot/src/list.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -w -r1.46 -r1.47
--- list.c 26 Mar 2004 18:30:32 -0000 1.46
+++ list.c 8 May 2004 13:54:15 -0000 1.47
@@ -1,7 +1,7 @@
/*
Copyright: (c) 2002 Leopold Toetsch <[EMAIL PROTECTED]>
License: Artistic/GPL, see README and LICENSES for details
-$Id: list.c,v 1.46 2004/03/26 18:30:32 leo Exp $
+$Id: list.c,v 1.47 2004/05/08 13:54:15 leo Exp $
=head1 NAME
@@ -1352,18 +1352,19 @@
list_mark(Interp *interpreter, List *list)
{
List_chunk *chunk;
- PObj *p;
+ PObj **p;
UINTVAL i;
for (chunk = list->first; chunk; chunk = chunk->next) {
pobject_lives(interpreter, (PObj *)chunk);
if (list->item_type == enum_type_PMC ||
list->item_type == enum_type_STRING) {
- if (!(chunk->flags & sparse))
- for (i = 0; i < chunk->items; i++) {
- p = ((PObj **) PObj_bufstart(&chunk->data))[i];
- if (p)
- pobject_lives(interpreter, p);
+ if (!(chunk->flags & sparse)) {
+ p = ((PObj **) PObj_bufstart(&chunk->data));
+ for (i = 0; i < chunk->items; i++, ++p) {
+ if (*p)
+ pobject_lives(interpreter, *p);
+ }
}
}