summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2012-11-23 00:57:41 -0800
committerSteffen Mueller <smueller@cpan.org>2012-11-23 15:24:17 +0100
commit22d874e2615631f6d150395ed856d7be7a9de5f2 (patch)
tree5204d604760b29a85ff5e693dc78c05af3a7bad9 /universal.c
parentc3a886583b8d98dea1a92cd9d0becd0e9a1f6bfd (diff)
downloadperl-22d874e2615631f6d150395ed856d7be7a9de5f2.tar.gz
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.
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/universal.c b/universal.c
index 805f376124..f58381746d 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 {