Author: nicholas
Date: Fri Dec 9 11:28:21 2005
New Revision: 379
Modified:
trunk/src/pmc/perl5refcount.pmc
Log:
Use the style of iteration from changes 26312 and 26313 in the Perl5RefCount
mark() code.
Modified: trunk/src/pmc/perl5refcount.pmc
==============================================================================
--- trunk/src/pmc/perl5refcount.pmc (original)
+++ trunk/src/pmc/perl5refcount.pmc Fri Dec 9 11:28:21 2005
@@ -25,36 +25,26 @@ pmclass Perl5RefCount dynpmc group Perl5
/* Yes this is evil and uses global variables. But it is temporary
code only needed until reference counting goes away, and this is
the simplest thing that could possibly work. */
- PTR_TBL_ENT_t **array;
- PTR_TBL_ENT_t *entry;
- UV riter;
- UV max;
- if (!PL_sv_arenatable || !PL_sv_arenatable->tbl_items) {
- return;
- }
+ if (PL_sv_arenatable &&PL_sv_arenatable->tbl_items) {
+ PTR_TBL_ENT_t **array = PL_sv_arenatable->tbl_ary;
+ UV riter = PL_sv_arenatable->tbl_max;
- array = PL_sv_arenatable->tbl_ary;
- entry = array[0];
- max = PL_sv_arenatable->tbl_max;
- PL_sv_arenatable->iteration_nesting++;
- riter = 0;
-
- for (;;) {
- if (entry) {
- if (entry->oldval) {
- pobject_lives(INTERP, (PObj *)MUMBLE(entry->oldval));
- }
- entry = entry->next;
- }
- if (!entry) {
- if (++riter > max) {
- break;
+ PL_sv_arenatable->iteration_nesting++;
+
+ do {
+ PTR_TBL_ENT_t *entry = array[riter];
+
+ while (entry) {
+ if (entry->oldval) {
+ pobject_lives(INTERP, (PObj *)MUMBLE(entry->oldval));
+ }
+ entry = entry->next;
}
- entry = array[riter];
- }
+ } while (riter--);
+
+ --PL_sv_arenatable->iteration_nesting;
}
- --PL_sv_arenatable->iteration_nesting;
}
}