summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-02 13:47:42 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-02 13:47:42 +0000
commit288b8c02c5ee89a2978a1b9e56ed255c53beb793 (patch)
tree6ae37841e6bccf1a6b817df3291f10c4e3b1783d /ext
parent84679df57ca0626f7fb35fc3038e2e142b97f8a4 (diff)
downloadperl-288b8c02c5ee89a2978a1b9e56ed255c53beb793.tar.gz
Make struct regexp the body of SVt_REGEXP SVs, REGEXPs become SVs,
and regexp reference counting is via the regular SV reference counting. This was not as easy at it looks. p4raw-id: //depot/perl@32804
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.xs8
-rw-r--r--ext/Devel/Peek/t/Peek.t5
2 files changed, 5 insertions, 8 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index a6f1d22dab..8f221223e9 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -1514,18 +1514,16 @@ IV
REGEX(sv)
B::REGEXP sv
CODE:
- RETVAL = PTR2IV(((struct xregexp *)SvANY(sv))->xrx_regexp);
+ /* FIXME - can we code this method more efficiently? */
+ RETVAL = PTR2IV(sv);
OUTPUT:
RETVAL
SV*
precomp(sv)
B::REGEXP sv
- REGEXP* rx = NO_INIT
CODE:
- rx = ((struct xregexp *)SvANY(sv))->xrx_regexp;
- /* FIXME - UTF-8? And the equivalent precomp methods? */
- RETVAL = newSVpvn( RX_PRECOMP(rx), RX_PRELEN(rx) );
+ RETVAL = newSVpvn( RX_PRECOMP(sv), RX_PRELEN(sv) );
OUTPUT:
RETVAL
diff --git a/ext/Devel/Peek/t/Peek.t b/ext/Devel/Peek/t/Peek.t
index 2c4cfbf679..af9dc02156 100644
--- a/ext/Devel/Peek/t/Peek.t
+++ b/ext/Devel/Peek/t/Peek.t
@@ -283,12 +283,11 @@ do_test(15,
FLAGS = \\(ROK\\)
RV = $ADDR
SV = REGEXP\\($ADDR\\) at $ADDR
- REFCNT = 1
+ REFCNT = 2
FLAGS = \\(\\)
IV = 0
NV = 0
- PV = 0
- REGEXP = $ADDR');
+ PV = 0');
} else {
do_test(15,
qr(tic),