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:
a804b0f
)
Merge the implementation of B::PV::{PVX,PV} using ALIAS.
author
Nicholas Clark
<nick@ccl4.org>
Sun, 7 Nov 2010 16:14:17 +0000
(16:14 +0000)
committer
Nicholas Clark
<nick@ccl4.org>
Mon, 8 Nov 2010 07:55:09 +0000
(07:55 +0000)
On this platform, this reduces the object size by .5K.
ext/B/B.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/B/B.xs
b/ext/B/B.xs
index
74d15fb
..
27e6d30
100644
(file)
--- a/
ext/B/B.xs
+++ b/
ext/B/B.xs
@@
-1600,10
+1600,6
@@
REGEX(sv)
MODULE = B PACKAGE = B::PV PREFIX = Sv
-char*
-SvPVX(sv)
- B::PV sv
-
B::SV
SvRV(sv)
B::PV sv
@@
-1620,12
+1616,17
@@
SvRV(sv)
void
SvPV(sv)
B::PV sv
+ ALIAS:
+ PVX = 1
PREINIT:
const char *p;
STRLEN len = 0;
U32 utf8 = 0;
CODE:
- if( SvPOK(sv) ) {
+ if (ix) {
+ p = SvPVX(sv);
+ len = strlen(p);
+ } else if (SvPOK(sv)) {
len = SvCUR(sv);
p = SvPVX_const(sv);
utf8 = SvUTF8(sv);