diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-04-06 19:50:12 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-04-06 19:50:12 +0000 |
commit | c2b1997a64b4faf9c52a72614bfeb0a1f6eeeba8 (patch) | |
tree | 3a5106000929fc04e6f93fc2d6887d2a74f610fa /sv.c | |
parent | 494364e0465f3123bb285c25f7aea65e01c763c4 (diff) | |
download | perl-c2b1997a64b4faf9c52a72614bfeb0a1f6eeeba8.tar.gz |
Remove op_pmnext from PMOPs, and instead store the list for reset as
an array hanging from the mg_ptr of the symbol table magic.
(Previously the linked list head was in the mg_obj member)
p4raw-id: //depot/perl@30853
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -7267,14 +7267,17 @@ Perl_sv_reset(pTHX_ register const char *s, HV *stash) if (!*s) { /* reset ?? searches */ MAGIC * const mg = mg_find((SV *)stash, PERL_MAGIC_symtab); if (mg) { - PMOP *pm = (PMOP *) mg->mg_obj; - while (pm) { + const U32 count = mg->mg_len / sizeof(PMOP**); + PMOP **pmp = (PMOP**) mg->mg_ptr; + PMOP *const *const end = pmp + count; + + while (pmp < end) { #ifdef USE_ITHREADS - SvREADONLY_off(PL_regex_pad[pm->op_pmoffset]); + SvREADONLY_off(PL_regex_pad[(*pmp)->op_pmoffset]); #else - pm->op_pmflags &= ~PMf_USED; + (*pmp)->op_pmflags &= ~PMf_USED; #endif - pm = pm->op_pmnext; + ++pmp; } } return; @@ -9651,9 +9654,6 @@ Perl_mg_dup(pTHX_ MAGIC *mg, CLONE_PARAMS* param) 1. */ nmg->mg_obj = SvREFCNT_inc(av_dup_inc((AV*) mg->mg_obj, param)); } - else if (mg->mg_type == PERL_MAGIC_symtab) { - nmg->mg_obj = mg->mg_obj; - } else { nmg->mg_obj = (mg->mg_flags & MGf_REFCOUNTED) ? sv_dup_inc(mg->mg_obj, param) |