summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-28 21:25:50 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-28 21:25:50 +0000
commit220fc49f9cd19ab777a22ef733671f0fbb81e6bd (patch)
treea91eae57fc34523216a9770d4b54a1f88987826b /ext
parentf19b4ba939a9fcdd83b091f4baa1c12b87ff9886 (diff)
downloadperl-220fc49f9cd19ab777a22ef733671f0fbb81e6bd.tar.gz
Wrap all accesses to the members precomp and prelen of struct regexp in
the macros RX_PRECOMP() and RX_PRELEN(). This will allow us to reduce the regexp storage overhead by computing them at retrieve time. p4raw-id: //depot/perl@32753
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.xs6
-rw-r--r--ext/re/re.xs2
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index caf2265633..6d5d2abdfd 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -1109,7 +1109,7 @@ PMOP_precomp(o)
ST(0) = sv_newmortal();
rx = PM_GETRE(o);
if (rx)
- sv_setpvn(ST(0), rx->precomp, rx->prelen);
+ sv_setpvn(ST(0), RX_PRECOMP(rx), RX_PRELEN(rx));
#if PERL_VERSION >= 9
@@ -1525,7 +1525,7 @@ precomp(sv)
CODE:
rx = ((struct xregexp *)SvANY(sv))->xrx_regexp;
/* FIXME - UTF-8? And the equivalent precomp methods? */
- RETVAL = newSVpvn( rx->precomp, rx->prelen );
+ RETVAL = newSVpvn( RX_PRECOMP(rx), RX_PRELEN(rx) );
OUTPUT:
RETVAL
@@ -1591,7 +1591,7 @@ precomp(mg)
REGEXP* rx = (REGEXP*)mg->mg_obj;
RETVAL = Nullsv;
if( rx )
- RETVAL = newSVpvn( rx->precomp, rx->prelen );
+ RETVAL = newSVpvn( RX_PRECOMP(rx), RX_PRELEN(rx) );
}
else {
croak( "precomp is only meaningful on r-magic" );
diff --git a/ext/re/re.xs b/ext/re/re.xs
index d1001c4e57..fa82127c85 100644
--- a/ext/re/re.xs
+++ b/ext/re/re.xs
@@ -116,7 +116,7 @@ PPCODE:
match_flags >>= 1;
}
- pattern = sv_2mortal(newSVpvn(re->precomp,re->prelen));
+ pattern = sv_2mortal(newSVpvn(RX_PRECOMP(re),RX_PRELEN(re)));
if (re->extflags & RXf_UTF8) SvUTF8_on(pattern);
/* return the pattern and the modifiers */