diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-11-26 22:21:02 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-11-26 22:21:02 +0000 |
commit | 23eab42ccdcdf01b414e4c1728d8f919b2705614 (patch) | |
tree | 5c97e4a5c50125c4362cc7fd8af226a264906601 /regcomp.c | |
parent | 0536c0a707b1bd3cc19a63305350f2cd34667109 (diff) | |
download | perl-23eab42ccdcdf01b414e4c1728d8f919b2705614.tar.gz |
Moving the reference count to the front of both _reg_trie_data and
_reg_ac_data allows smaller code in Perl_regdupe.
p4raw-id: //depot/perl@29391
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -8714,6 +8714,13 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param) d->data[i] = (void*)OpREFCNT_inc((OP*)ri->data->data[i]); OP_REFCNT_UNLOCK; break; + case 'T': + /* Trie stclasses are readonly and can thus be shared + * without duplication. We free the stclass in pregfree + * when the corresponding reg_ac_data struct is freed. + */ + reti->regstclass= ri->regstclass; + /* Fall through */ case 't': OP_REFCNT_LOCK; ((reg_trie_data*)ri->data->data[i])->refcount++; @@ -8722,17 +8729,6 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param) case 'n': d->data[i] = ri->data->data[i]; break; - case 'T': - d->data[i] = ri->data->data[i]; - OP_REFCNT_LOCK; - ((reg_ac_data*)d->data[i])->refcount++; - OP_REFCNT_UNLOCK; - /* Trie stclasses are readonly and can thus be shared - * without duplication. We free the stclass in pregfree - * when the corresponding reg_ac_data struct is freed. - */ - reti->regstclass= ri->regstclass; - break; default: Perl_croak(aTHX_ "panic: re_dup unknown data code '%c'", ri->data->what[i]); } |