This results in the same CV being used twice, rather than two CVs being created
that point to the same XS code implementation, shrinking the memory usage of B
slightly (168 bytes on this platform). It also is fewer source lines. :-)
*B::IV::as_string = \&B::IV::int_value;
*B::PV::as_string = \&B::PV::PV;
+# The input typemap checking makes no distinction between different SV types,
+# so the XS body will generate the same C code, despite the different XS
+# "types". So there is no change in behaviour from doing "newXS" like this,
+# compared with the old approach of having a (near) duplicate XS body.
+# We should fix the typemap checking.
+*B::IV::RV = \&B::PV::RV if $] > 5.012;
+
my $debug;
my $op_count = 0;
my @parents = ();
ST(0) = newSVpvn_flags((char *)&w, 4, SVs_TEMP);
}
-#if PERL_VERSION >= 11
-# The input typemap checking makes no distinction between different SV types,
-# so the XS body will generate the same C code, despite the different XS
-# "types". So there is no change in behaviour from doing newXS like this,
-# compared with the old approach of having a (near) duplicate XS body.
-# We should fix the typemap checking.
-
-BOOT:
- newXS("B::IV::RV", XS_B__PV_RV, __FILE__);
-
-#endif
-
MODULE = B PACKAGE = B::NV PREFIX = Sv
NV