diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-12-28 22:19:00 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-12-28 22:19:00 +0000 |
commit | 2c96c0d61ce80822b81de2248e48b10f0182d790 (patch) | |
tree | 04308778310b8943cb90138b157fdfe8d25591d2 /regcomp.c | |
parent | 3a9b2cacfb08e1181b7d9ae45cad1ed8acd59972 (diff) | |
download | perl-2c96c0d61ce80822b81de2248e48b10f0182d790.tar.gz |
Eliminate precomp from struct regexp. Store the offset of precomp from
wrapped in pre_prefix, a 4 bit value. (Maybe only for now) reduce
seen_evals from I32 to 28 bits. Will anyone have more than 268435456
eval groups in a regexp?
p4raw-id: //depot/perl@32755
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -4319,7 +4319,8 @@ redo_first_pass: *p++ = ':'; Copy(RExC_precomp, p, RX_PRELEN(r), char); - RX_PRECOMP(r) = p; + assert ((r->wrapped - p) < 16); + r->pre_prefix = p - r->wrapped; p += RX_PRELEN(r); if (has_runon) *p++ = '\n'; @@ -9371,7 +9372,6 @@ Perl_re_dup(pTHX_ const regexp *r, CLONE_PARAMS *param) dVAR; regexp *ret; I32 npar; - U32 precomp_offset; if (!r) return (REGEXP *)NULL; @@ -9420,10 +9420,7 @@ Perl_re_dup(pTHX_ const regexp *r, CLONE_PARAMS *param) } } - precomp_offset = RX_PRECOMP(ret) - ret->wrapped; - ret->wrapped = SAVEPVN(ret->wrapped, ret->wraplen+1); - RX_PRECOMP(ret) = ret->wrapped + precomp_offset; ret->paren_names = hv_dup_inc(ret->paren_names, param); if (ret->pprivate) |