This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
89c6bc1
)
In B::REGEX::precomp, use newSVpvn_flags() instead of newSVpvn().
author
Nicholas Clark
<nick@ccl4.org>
Sun, 7 Nov 2010 10:36:57 +0000
(10:36 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Mon, 8 Nov 2010 07:55:09 +0000
(07:55 +0000)
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
patch
|
blob
|
blame
|
history
diff --git
a/ext/B/B.xs
b/ext/B/B.xs
index
3e10f3c
..
813ad8f
100644
(file)
--- 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