summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-27 07:13:15 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-27 07:14:01 -0800
commite6d4bf4347b8c0153b4a3a24ad9a3dd109cd0583 (patch)
treeaae8e23dc0b683cf272f492ba183e8c4d54e0175
parent86d1dcd79d0778ebfa3c5561b4e1d0988a942008 (diff)
downloadperl-e6d4bf4347b8c0153b4a3a24ad9a3dd109cd0583.tar.gz
Revert "Squash COWs in the char* typemap"
This reverts commit 77ca9de6373481d905eed6af2904599353a658b3.
-rw-r--r--ext/XS-Typemap/Typemap.pm2
-rw-r--r--ext/XS-Typemap/Typemap.xs22
-rw-r--r--ext/XS-Typemap/t/Typemap.t13
-rw-r--r--lib/ExtUtils/typemap22
4 files changed, 3 insertions, 56 deletions
diff --git a/ext/XS-Typemap/Typemap.pm b/ext/XS-Typemap/Typemap.pm
index d78134f7cf..583726a528 100644
--- a/ext/XS-Typemap/Typemap.pm
+++ b/ext/XS-Typemap/Typemap.pm
@@ -66,7 +66,7 @@ $VERSION = '0.12';
T_FLOAT
T_NV
T_DOUBLE
- T_PV T_PV_null T_PV_mutate T_ROPV
+ T_PV T_PV_null
T_PTR_IN T_PTR_OUT
T_PTRREF_IN T_PTRREF_OUT
T_REF_IV_REF
diff --git a/ext/XS-Typemap/Typemap.xs b/ext/XS-Typemap/Typemap.xs
index 8892ea697b..0eb68e54ee 100644
--- a/ext/XS-Typemap/Typemap.xs
+++ b/ext/XS-Typemap/Typemap.xs
@@ -579,28 +579,6 @@ T_PV_null()
OUTPUT:
RETVAL
-void
-T_PV_mutate( in, repl, len )
- char * in
- char * repl
- STRLEN len
- PREINIT:
- STRLEN i = 0;
- CODE:
- for (; i < len; i++)
- in[i] = repl[i];
-
-
-## T_ROPV
-
-const char *
-T_ROPV( in )
- const char * in
- CODE:
- RETVAL = in;
- OUTPUT:
- RETVAL
-
## T_PTR
diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t
index 0a3994d10d..e251c55e7f 100644
--- a/ext/XS-Typemap/t/Typemap.t
+++ b/ext/XS-Typemap/t/Typemap.t
@@ -6,7 +6,7 @@ BEGIN {
}
}
-use Test::More tests => 152;
+use Test::More tests => 148;
use strict;
use warnings;
@@ -218,17 +218,6 @@ ok !defined T_PV_null, 'RETVAL = NULL returns undef for char*';
() = ''.T_PV_null;
is $uninit, 1, 'uninit warning from NULL returned from char* func';
}
-for my $cow (keys %{{foo=>1}}) {
- my $cow2 = $cow;
- T_PV_mutate($cow, "bar", 2);
- is( $cow, "bao", "mutating cows via char* param" );
- is( $cow2, "foo", "kin kine are unaffected" );
-}
-
-# T_ROPV
-note("T_ROPV");
-is( T_ROPV("a string"), "a string");
-is( T_ROPV(52), 52);
# T_PTR
my $t = 5;
diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap
index 0380419077..874bc161a8 100644
--- a/lib/ExtUtils/typemap
+++ b/lib/ExtUtils/typemap
@@ -10,7 +10,7 @@ char T_CHAR
unsigned char T_U_CHAR
char * T_PV
unsigned char * T_PV
-const char * T_ROPV
+const char * T_PV
caddr_t T_PV
wchar_t * T_PV
wchar_t T_IV
@@ -200,24 +200,6 @@ T_NV
T_DOUBLE
$var = (double)SvNV($arg)
T_PV
- STMT_START {
- SV * const t_pv_tmp_sv = $arg;
- /* Note: This code works in 5.16 as well as 5.20, which is
- not strictly necessary, since this typemap is not dual-
- lifed. However, keeping this extra logic will make it
- easier to backport if we decide to dual-life it, or if
- someone copies the latest typemap into a CPAN dist. */
- /* This takes advantage of the fact that SvIsCOW always
- returned 1 or 0 back when all COWs were marked read-only
- (pre-v5.17.5-484-ge3918bb0, when SvREADONLY did not nec-
- essarily actually mean read-only) and SVf_IsCOW or 0
- thereafter. */
- if ((SvIsCOW(t_pv_tmp_sv) && !SvREADONLY(t_pv_tmp_sv))
- || SvIsCOW(t_pv_tmp_sv) == 1)
- sv_force_normal(t_pv_tmp_sv);
- $var = ($type)SvPV_nolen(t_pv_tmp_sv);
- } STMT_END
-T_ROPV
$var = ($type)SvPV_nolen($arg)
T_PTR
$var = INT2PTR($type,SvIV($arg))
@@ -369,8 +351,6 @@ T_DOUBLE
sv_setnv($arg, (double)$var);
T_PV
sv_setpv((SV*)$arg, $var);
-T_ROPV
- sv_setpv((SV*)$arg, $var);
T_PTR
sv_setiv($arg, PTR2IV($var));
T_PTRREF