From 288b8c02c5ee89a2978a1b9e56ed255c53beb793 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 2 Jan 2008 13:47:42 +0000 Subject: 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 --- ext/B/B.xs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ext/B') 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 -- cgit v1.2.1