From 154b88420588b0827f180ef3f77658ea35d8b3e7 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 7 Nov 2010 10:36:57 +0000 Subject: [PATCH] In B::REGEX::precomp, use newSVpvn_flags() instead of newSVpvn(). Using newSVpvn_flags() and SVt_TEMP and an explicit push is one API call. newSVpvn() and RETVAL results in a second API call, sv_2mortal(), in the return typemap. --- ext/B/B.xs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/B/B.xs b/ext/B/B.xs index 3e10f3c..813ad8f 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1591,13 +1591,11 @@ REGEX(sv) OUTPUT: RETVAL -SV* +void precomp(sv) B::REGEXP sv - CODE: - RETVAL = newSVpvn( RX_PRECOMP(sv), RX_PRELEN(sv) ); - OUTPUT: - RETVAL + PPCODE: + PUSHs(newSVpvn_flags(RX_PRECOMP(sv), RX_PRELEN(sv), SVs_TEMP)); #endif -- 1.8.3.1