In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/22d874e2615631f6d150395ed856d7be7a9de5f2?hp=c3a886583b8d98dea1a92cd9d0becd0e9a1f6bfd>
- Log ----------------------------------------------------------------- commit 22d874e2615631f6d150395ed856d7be7a9de5f2 Author: Daniel Dragan <[email protected]> Date: Fri Nov 23 00:57:41 2012 -0800 remove an EXTEND from XS_re_regexp_pattern Replace 2 EXTENDs with 1. Whether the stack is extended by 1 or 2 makes no signifigant memory difference, so use the large value of 2. Less machine code is the purpose. This XSUB went from 0x1C2 long to 0x19E for me after these changes on VC 2003 x86 32bit. The SP and items was moved so items is tossed a tiny bit sooner by the compiler in case the compiler tries to save it because it doesn't recogize noreturn declared funcs. ----------------------------------------------------------------------- Summary of changes: universal.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/universal.c b/universal.c index 805f376..f583817 100644 --- a/universal.c +++ b/universal.c @@ -1219,11 +1219,11 @@ XS(XS_re_regexp_pattern) dXSARGS; REGEXP *re; + EXTEND(SP, 2); + SP -= items; if (items != 1) croak_xs_usage(cv, "sv"); - SP -= items; - /* Checks if a reference is a regex or not. If the parameter is not a ref, or is not the result of a qr// then returns false @@ -1275,7 +1275,6 @@ XS(XS_re_regexp_pattern) (RX_UTF8(re) ? SVf_UTF8 : 0) | SVs_TEMP); /* return the pattern and the modifiers */ - EXTEND(SP, 2); PUSHs(pattern); PUSHs(newSVpvn_flags(reflags, left, SVs_TEMP)); XSRETURN(2); @@ -1288,7 +1287,7 @@ XS(XS_re_regexp_pattern) pattern = newSVpvn_flags(RX_WRAPPED(re), RX_WRAPLEN(re), (RX_UTF8(re) ? SVf_UTF8 : 0) | SVs_TEMP); #endif - XPUSHs(pattern); + PUSHs(pattern); XSRETURN(1); } } else { -- Perl5 Master Repository
