This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge the implementation of B::IV::{needs64bits,packiv} using ALIAS.
authorNicholas Clark <nick@ccl4.org>
Sat, 30 Oct 2010 11:09:26 +0000 (12:09 +0100)
committerNicholas Clark <nick@ccl4.org>
Sat, 30 Oct 2010 11:09:26 +0000 (12:09 +0100)
ext/B/B.xs

index a05cbc6..42bc5e5 100644 (file)
@@ -1340,17 +1340,15 @@ SvUVX(sv)
 
 MODULE = B     PACKAGE = B::IV
 
-#define needs64bits(sv) ((I32)SvIVX(sv) != SvIVX(sv))
-
-int
-needs64bits(sv)
-       B::IV   sv
-
 void
 packiv(sv)
        B::IV   sv
+    ALIAS:
+       needs64bits = 1
     CODE:
-       if (sizeof(IV) == 8) {
+       if (ix) {
+           ST(0) = boolSV((I32)SvIVX(sv) != SvIVX(sv));
+       } else if (sizeof(IV) == 8) {
            U32 wp[2];
            const IV iv = SvIVX(sv);
            /*