summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-03-26 22:52:18 +0000
committerNicholas Clark <nick@ccl4.org>2007-03-26 22:52:18 +0000
commitf0ab9afb53ef594bb6fb8989153fbfba9762816f (patch)
treea85cb73f7a598badd81595546dcbf6c972e35978 /pp_ctl.c
parent82a7479cc5a6419185bb7d8b5f033dc6e60e261b (diff)
downloadperl-f0ab9afb53ef594bb6fb8989153fbfba9762816f.tar.gz
In struct regexp replace the two arrays of I32s accessed via startp
and endp with a single array of struct regexp_paren_pair, which has 2 I32 members. PL_regstartp and PL_regendp are replaced with a pointer to regexp_paren_pair. The regexp swap structure now only has one member, so abolish it and store the pointer to the swap array directly. Hopefully keeping the corresponding start and end adjacent in memory will help with cache coherency. p4raw-id: //depot/perl@30769
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 124a40fa08..3d4992f118 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -279,14 +279,14 @@ PP(pp_substcont)
s = orig + (m - s);
cx->sb_strend = s + (cx->sb_strend - m);
}
- cx->sb_m = m = rx->startp[0] + orig;
+ cx->sb_m = m = rx->offs[0].start + orig;
if (m > s) {
if (DO_UTF8(dstr) && !SvUTF8(cx->sb_targ))
sv_catpvn_utf8_upgrade(dstr, s, m - s, nsv);
else
sv_catpvn(dstr, s, m-s);
}
- cx->sb_s = rx->endp[0] + orig;
+ cx->sb_s = rx->offs[0].end + orig;
{ /* Update the pos() information. */
SV * const sv = cx->sb_targ;
MAGIC *mg;
@@ -345,8 +345,8 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx)
*p++ = PTR2UV(rx->subbeg);
*p++ = (UV)rx->sublen;
for (i = 0; i <= rx->nparens; ++i) {
- *p++ = (UV)rx->startp[i];
- *p++ = (UV)rx->endp[i];
+ *p++ = (UV)rx->offs[i].start;
+ *p++ = (UV)rx->offs[i].end;
}
}
@@ -373,8 +373,8 @@ Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
rx->subbeg = INT2PTR(char*,*p++);
rx->sublen = (I32)(*p++);
for (i = 0; i <= rx->nparens; ++i) {
- rx->startp[i] = (I32)(*p++);
- rx->endp[i] = (I32)(*p++);
+ rx->offs[i].start = (I32)(*p++);
+ rx->offs[i].end = (I32)(*p++);
}
}