r62578 - in /trunk/libmath-bigint-gmp-perl: CHANGES GMP.xs MANIFEST MANIFEST.SKIP META.yml Makefile.PL SIGNATURE debian/changelog inc/ lib/Math/BigInt/GMP.pm t/bigintpm.inc t/bigintpm.t t/threads.t typemap

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Tue Sep 14 21:34:22 UTC 2010


Author: gregoa
Date: Tue Sep 14 21:34:08 2010
New Revision: 62578

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62578
Log:
New upstream release.

Added:
    trunk/libmath-bigint-gmp-perl/inc/
      - copied from r62577, branches/upstream/libmath-bigint-gmp-perl/current/inc/
    trunk/libmath-bigint-gmp-perl/t/threads.t
      - copied unchanged from r62577, branches/upstream/libmath-bigint-gmp-perl/current/t/threads.t
Modified:
    trunk/libmath-bigint-gmp-perl/CHANGES
    trunk/libmath-bigint-gmp-perl/GMP.xs
    trunk/libmath-bigint-gmp-perl/MANIFEST
    trunk/libmath-bigint-gmp-perl/MANIFEST.SKIP
    trunk/libmath-bigint-gmp-perl/META.yml
    trunk/libmath-bigint-gmp-perl/Makefile.PL
    trunk/libmath-bigint-gmp-perl/SIGNATURE
    trunk/libmath-bigint-gmp-perl/debian/changelog
    trunk/libmath-bigint-gmp-perl/lib/Math/BigInt/GMP.pm
    trunk/libmath-bigint-gmp-perl/t/bigintpm.inc
    trunk/libmath-bigint-gmp-perl/t/bigintpm.t
    trunk/libmath-bigint-gmp-perl/typemap

Modified: trunk/libmath-bigint-gmp-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/CHANGES?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/CHANGES (original)
+++ trunk/libmath-bigint-gmp-perl/CHANGES Tue Sep 14 21:34:08 2010
@@ -1,3 +1,10 @@
+2010-09-14 v1.06 rafl 5558 tests  DEVELOPMENT RELEASE
+  * Error out early if libgmp or gmp.h are missing.
+  * Clone Math::BigInt::GMP instances on thread cloning.
+    This should make the module threadsafe.
+
+2010-09-10 v1.25 rafl 5536 tests
+  * Fix tests with Math::BigInt >= 1.90 and depend on it.
 
 2007-07-31 v1.24 Tels 5530 tests
   * apply patch for warnings about ptr size mismatch under Cygwin (thanx Reini Urban!)

Modified: trunk/libmath-bigint-gmp-perl/GMP.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/GMP.xs?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/GMP.xs (original)
+++ trunk/libmath-bigint-gmp-perl/GMP.xs Tue Sep 14 21:34:08 2010
@@ -8,6 +8,86 @@
 #  define SvUOK(sv) SvIOK_UV(sv)
 #endif
 
+#define NEW_GMP_MPZ_T	   RETVAL = malloc (sizeof(mpz_t));
+#define NEW_GMP_MPZ_T_INIT RETVAL = malloc (sizeof(mpz_t)); mpz_init(*RETVAL);
+#define GMP_GET_ARG_0      TEMP = mpz_from_sv(x);
+#define GMP_GET_ARG_1 	   TEMP_1 = mpz_from_sv(y);
+#define GMP_GET_ARGS_0_1   GMP_GET_ARG_0; GMP_GET_ARG_1;
+
+#ifdef USE_ITHREADS
+STATIC int
+dup_gmp_mpz (pTHX_ MAGIC *mg, CLONE_PARAMS *params)
+{
+  mpz_t *RETVAL;
+  PERL_UNUSED_ARG(params);
+  NEW_GMP_MPZ_T;
+  mpz_init_set(*RETVAL, *((mpz_t *)mg->mg_ptr));
+  mg->mg_ptr = (char *)RETVAL;
+  return 0;
+}
+#endif
+
+STATIC MGVTBL vtbl_gmp = {
+  NULL, /* get */
+  NULL, /* set */
+  NULL, /* len */
+  NULL, /* clear */
+  NULL, /* free */
+#ifdef MGf_COPY
+  NULL, /* copy */
+#endif
+#ifdef MGf_DUP
+# ifdef USE_ITHREADS
+  dup_gmp_mpz,
+# else
+  NULL, /* dup */
+# endif
+#endif
+#ifdef MGf_LOCAL
+  NULL, /* local */
+#endif
+};
+
+STATIC SV *
+sv_from_mpz (mpz_t *mpz)
+{
+  SV *sv = newSV(0);
+  SV *obj = newRV_noinc(sv);
+#ifdef USE_ITHREADS
+  MAGIC *mg;
+#endif
+
+  sv_bless(obj, gv_stashpvs("Math::BigInt::GMP", 0));
+
+#ifdef USE_ITHREADS
+  mg =
+#endif
+    sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_gmp, (void *)mpz, 0);
+
+#ifdef USE_ITHREADS
+  mg->mg_flags |= MGf_DUP;
+#endif
+
+  return obj;
+}
+
+mpz_t *
+mpz_from_sv (SV *sv)
+{
+  MAGIC *mg;
+
+  if (!sv_derived_from(sv, "Math::BigInt::GMP"))
+    croak("not of type Math::BigInt::GMP");
+
+  for (mg = SvMAGIC(SvRV(sv)); mg; mg = mg->mg_moremagic) {
+    if (mg->mg_type == PERL_MAGIC_ext && mg->mg_virtual == &vtbl_gmp) {
+      return (mpz_t *)mg->mg_ptr;
+    }
+  }
+
+  croak("failed to fetch mpz pointer");
+}
+
 /*
 Math::BigInt::GMP XS code, loosely based on Math::GMP, a Perl module for
 high-speed arbitrary size integer calculations (C) 2000 James H. Turner
@@ -15,18 +95,6 @@
 
 MODULE = Math::BigInt::GMP		PACKAGE = Math::BigInt::GMP
 PROTOTYPES: ENABLE
-
-#define NEW_GMP_MPZ_T	   RETVAL = malloc (sizeof(mpz_t));
-#define NEW_GMP_MPZ_T_INIT RETVAL = malloc (sizeof(mpz_t)); mpz_init(*RETVAL);
-#define GMP_GET_ARG_0 	   if (sv_derived_from(x, "Math::BigInt::GMP")) {\
-			   IV tmp = SvIV((SV*)SvRV(x));\
-			   TEMP = INT2PTR(mpz_t*, tmp);\
-		  } else { croak("x is not of type Math::BigInt::GMP"); }
-#define GMP_GET_ARG_1 	   if (sv_derived_from(y, "Math::BigInt::GMP")) {\
-			   IV tmp = SvIV((SV*)SvRV(y));\
-			   TEMP_1 = INT2PTR(mpz_t*, tmp);\
-		  } else { croak("y is not of type Math::BigInt::GMP"); }
-#define GMP_GET_ARGS_0_1   GMP_GET_ARG_0; GMP_GET_ARG_1;
 
 ##############################################################################
 # _new() 
@@ -406,7 +474,7 @@
       sign = mpz_sgn (*RETVAL);
       /* absolute result */
       mpz_abs (*RETVAL, *RETVAL);
-      PUSHs(sv_setref_pv(sv_newmortal(), "Math::BigInt::GMP", (void*)RETVAL));
+      PUSHs(sv_2mortal(sv_from_mpz(RETVAL)));
       if (sign >= 0)
         {
         PUSHs ( &PL_sv_undef );	/* result is ok, keep it */
@@ -597,7 +665,7 @@
       mpz_tdiv_qr(*TEMP, *rem, *TEMP, *TEMP_1);
       EXTEND(SP, 2);
       PUSHs( x );
-      PUSHs(sv_setref_pv(sv_newmortal(), "Math::BigInt::GMP", (void*)rem));
+      PUSHs(sv_2mortal(sv_from_mpz(rem)));
       }
     else
       {

Modified: trunk/libmath-bigint-gmp-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/MANIFEST?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/MANIFEST (original)
+++ trunk/libmath-bigint-gmp-perl/MANIFEST Tue Sep 14 21:34:08 2010
@@ -5,23 +5,25 @@
 CHANGES
 CREDITS
 GMP.xs
+inc/Devel/CheckLib.pm
 INSTALL
 lib/Math/BigInt/GMP.pm
 LICENSE
 Makefile.PL
-MANIFEST
+MANIFEST			This list of files
 MANIFEST.SKIP
-META.yml			Module meta-data (added by MakeMaker)
+META.yml
 README
-SIGNATURE
-t/bigfltpm.inc			# actual tests
-t/bigfltpm.t			# original test, but with Math::GMP 
-t/bigintg.t			# Math::GMP implementation of uint math core
-t/bigintpm.inc			# actual tests
-t/bigintpm.t			# original test, but with Math::GMP
+t/bigfltpm.inc
+t/bigfltpm.t
+t/bigintg.t
+t/bigintpm.inc
+t/bigintpm.t
 t/biglog.t
 t/bigroot.t
 t/pod.t
 t/pod_cov.t
+t/threads.t
 TODO
 typemap
+SIGNATURE                                Public-key signature (added by MakeMaker)

Modified: trunk/libmath-bigint-gmp-perl/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/MANIFEST.SKIP?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/MANIFEST.SKIP (original)
+++ trunk/libmath-bigint-gmp-perl/MANIFEST.SKIP Tue Sep 14 21:34:08 2010
@@ -6,3 +6,4 @@
 ^Makefile.(old|bak)\z
 .*\.patch\z
 pm_to_blib
+\.git

Modified: trunk/libmath-bigint-gmp-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/META.yml?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/META.yml (original)
+++ trunk/libmath-bigint-gmp-perl/META.yml Tue Sep 14 21:34:08 2010
@@ -1,12 +1,12 @@
 ---
 name: Math-BigInt-GMP
 author: Tels
-version: 1.24
+version: 1.26
 version_from: lib/Math/BigInt/GMP.pm
 license: perl
 distribution_type: module
-generated_by: Math-BigInt-GMP version 1.24
+generated_by: Math-BigInt-GMP version 1.26
 installdirs: site
 requires:
-  Math::BigInt: 1.87
+  Math::BigInt: 1.9
   XSLoader: 0.02

Modified: trunk/libmath-bigint-gmp-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/Makefile.PL?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/Makefile.PL (original)
+++ trunk/libmath-bigint-gmp-perl/Makefile.PL Tue Sep 14 21:34:08 2010
@@ -1,4 +1,6 @@
 use ExtUtils::MakeMaker;
+use lib 'inc'; # load our bundled version of Devel::CheckLib
+use Devel::CheckLib;
 
 #printf "Your OS is [%s]!\n---\n", $Config::Config{'osname'};  ### for testing purpose only
 
@@ -42,12 +44,15 @@
   "metafile:\n$dump";
   }
 
+check_lib_or_exit(lib => 'gmp', header => 'gmp.h', @ARGV);
+
 WriteMakefile(
     'NAME'		=> 'Math::BigInt::GMP',
     'VERSION_FROM'	=> 'lib/Math/BigInt/GMP.pm',
     'PREREQ_PM'		=> {
-				Math::BigInt => 1.87,
+				Math::BigInt => 1.90,
 				XSLoader => 0.02,
-			   }, 
+			   },
     'LIBS'		=> ['-lgmp'],
+    'SIGN' => 1,
 );

Modified: trunk/libmath-bigint-gmp-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/SIGNATURE?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/SIGNATURE (original)
+++ trunk/libmath-bigint-gmp-perl/SIGNATURE Tue Sep 14 21:34:08 2010
@@ -1,5 +1,5 @@
 This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.54.
+signed via the Module::Signature module, version 0.66.
 
 To verify the content in this distribution, first make sure you have
 Module::Signature installed, then type:
@@ -15,39 +15,37 @@
 Hash: SHA1
 
 SHA1 70d6187d0152848c922dc4360fa6dd3a3dc35c62 BUGS
-SHA1 271b61ffaf1918eb85e45c4858226ccfbcb4862a CHANGES
+SHA1 6fd2ead704ecb3644c53e9233b20f479623c996e CHANGES
 SHA1 dda5ca4f413031e9efcaa1600461d5e2adaa3a40 CREDITS
-SHA1 c677a382a0301544ac58c83a44e25a8d46b22452 GMP.xs
+SHA1 1566e65e25fdde8f02c28bda8d04372c9fcac7a8 GMP.xs
 SHA1 fcb1ead705a964b5555ff355534cbcf8b4c176e5 INSTALL
 SHA1 d6a6c30ee6d9ba6b9afab8bbf6a25e1b23c744e0 LICENSE
-SHA1 574a4f3bc668e1d2d05c189efa46850bd828c79b MANIFEST
-SHA1 3716b684ad7f66e9f75a5cfa0737098b41dc0730 MANIFEST.SKIP
-SHA1 072edad617c9e588799181b23239508d734e8cec META.yml
-SHA1 7d63c7c9dfc21bd36110f9874a5a0c5a6c313adf Makefile.PL
+SHA1 d92d036825f848456802a2100373b7e021c1e4ed MANIFEST
+SHA1 f3190cb30c8df53e0fd78658ff9a6132e031042e MANIFEST.SKIP
+SHA1 6e2929ced41261ad0ec01242f7d8deacbd921833 META.yml
+SHA1 32b33a1c160e1efbf82b1bf8765cde8455a32550 Makefile.PL
 SHA1 e9de29b6e5e9a5e446231b5b12b644f6ed2caafc README
 SHA1 acf3dd42f0d8a87dd02ef9f5f74b894423ffd4d8 TODO
 SHA1 fd48d0d8750eb949e485d8136b5b424fe73e9775 build/README
 SHA1 7bcc4113830721ad6e37a1ea79df94a6987c836d build/leak.pl
 SHA1 ac25bda8a6eb9058a9e42a8943c3e11b9fed88dc build/leaktest
-SHA1 ff5fe9462852f64ddadd111b3a12a74a19c84f5c lib/Math/BigInt/GMP.pm
+SHA1 332c820b17158bafd87fb16c7e1401b29976952d inc/Devel/CheckLib.pm
+SHA1 463062389a2990c4a3079ffdfa351220fa3ed014 lib/Math/BigInt/GMP.pm
 SHA1 b389295c7eb542fb89f55d37390a35ac582b5e6c t/bigfltpm.inc
 SHA1 a6659404498c1d7b74e055769710e00bf425e355 t/bigfltpm.t
 SHA1 0f8838bf47e9c21a95bc15db11f435836440525c t/bigintg.t
-SHA1 383a30546458b7a21e4f34aea66c2b813003c3db t/bigintpm.inc
-SHA1 9aaaaed58b9a32c0f44d3c531ee39ff1f0092f2c t/bigintpm.t
+SHA1 1d063362c7a32e4fb0bfc756751481b75881e4bf t/bigintpm.inc
+SHA1 a1b919d7ec294a89ceb738a17cb986689ff80c98 t/bigintpm.t
 SHA1 b68535cf9a33efa949c80b166302a866fd13cff9 t/biglog.t
 SHA1 7eda06bd6d27b4092ab7266b1659e3a6ed369b26 t/bigroot.t
 SHA1 17935f6d2607dfd441f6f59d69d5aaf282a16bfc t/pod.t
 SHA1 c7406b64a2eff28ca33248f647eee3199deb10dc t/pod_cov.t
-SHA1 af431c9de0cf037af2118a77c7110655fa3f427f typemap
+SHA1 808b09f78be228a7d6c91a3206ca5a10ca179c23 t/threads.t
+SHA1 d6074079ab439bd3485ed2a5d784996fcd9e717d typemap
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
+Version: GnuPG v1.4.10 (GNU/Linux)
 
-iQEVAwUBRq9VV3cLPEOTuEwVAQL8NQf/RSVGXcdNQqo3kgBv7S6mTXaigx2vXYlv
-rT828kebA4Kh2K+4+0Ye9Ol3utJG8gZgWToDhVn8xOcmEOxM5ZI/DncY5ipG3EgE
-ZZcbaQQ6K0jOlZPxBMUhA7TbWX+AjnyG5H/zAtuvneB+LHfbHy5F1rRgJOzgjkg+
-YZqcyYqmC2tHMpeZ5UZXPZujHLfTwlIH8hdt15fb9oiS6vGaky+e4iMSQM5LmRjD
-nXQN/yPwdQbNr/GB4333knl/WU5OBBcO4ynxvWMoHHZEECCTTPE+W7wj19Eogzl3
-D42zFB7NqUya8k+SEtAZ50BRGVjx0GJ6Yx8vRdwepmnZ4iOjhylUeg==
-=BeBy
+iEYEARECAAYFAkyPqXsACgkQdC8qQo5jWl52pACdHSTVHW9GW4gZI6IMwxbUT7Hw
+qmgAnRYTZ3a//CB+lkDxAd4MVqmDF500
+=embN
 -----END PGP SIGNATURE-----

Modified: trunk/libmath-bigint-gmp-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/debian/changelog?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/debian/changelog (original)
+++ trunk/libmath-bigint-gmp-perl/debian/changelog Tue Sep 14 21:34:08 2010
@@ -1,4 +1,4 @@
-libmath-bigint-gmp-perl (1.24-2) UNRELEASED; urgency=low
+libmath-bigint-gmp-perl (1.26-1) UNRELEASED; urgency=low
 
   [ gregor herrmann ]
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
@@ -7,7 +7,12 @@
   [ Nathan Handler ]
   * debian/watch: Update to ignore development releases.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:44:37 +0100
+  [ gregor herrmann ]
+  * New upstream release; the dist is named 1.26-TRIAL on CPAN (dev release);
+    upload as 1.26 and leave watch file since 1.27 should be the next release.
+    Upload to experimental. Closes: #395948.
+
+ -- gregor herrmann <gregoa at debian.org>  Tue, 14 Sep 2010 23:29:49 +0200
 
 libmath-bigint-gmp-perl (1.24-1) unstable; urgency=low
 

Modified: trunk/libmath-bigint-gmp-perl/lib/Math/BigInt/GMP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/lib/Math/BigInt/GMP.pm?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/lib/Math/BigInt/GMP.pm (original)
+++ trunk/libmath-bigint-gmp-perl/lib/Math/BigInt/GMP.pm Tue Sep 14 21:34:08 2010
@@ -9,7 +9,7 @@
 
 use vars qw/$VERSION/;
 
-$VERSION = '1.24';
+$VERSION = '1.26';
 
 use XSLoader;
 XSLoader::load "Math::BigInt::GMP", $VERSION;

Modified: trunk/libmath-bigint-gmp-perl/t/bigintpm.inc
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/t/bigintpm.inc?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/t/bigintpm.inc (original)
+++ trunk/libmath-bigint-gmp-perl/t/bigintpm.inc Tue Sep 14 21:34:08 2010
@@ -2246,9 +2246,12 @@
 1:-2:0
 # 7 over 3 = 35
 7:3:35
-7:6:1
+7:6:7
 100:90:17310309456440
 100:95:75287520
+2:0:1
+7:0:1
+2:1:2
 &bround
 $round_mode('trunc')
 0:12:0

Modified: trunk/libmath-bigint-gmp-perl/t/bigintpm.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/t/bigintpm.t?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/t/bigintpm.t (original)
+++ trunk/libmath-bigint-gmp-perl/t/bigintpm.t Tue Sep 14 21:34:08 2010
@@ -11,7 +11,7 @@
   unshift @INC, $location; # to locate the testing files
   unshift @INC, '../blib/arch';
   chdir 't' if -d 't';
-  plan tests => 3043;
+  plan tests => 3049;
   }
 
 use Math::BigInt lib => 'GMP';

Modified: trunk/libmath-bigint-gmp-perl/typemap
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmath-bigint-gmp-perl/typemap?rev=62578&op=diff
==============================================================================
--- trunk/libmath-bigint-gmp-perl/typemap (original)
+++ trunk/libmath-bigint-gmp-perl/typemap Tue Sep 14 21:34:08 2010
@@ -2,13 +2,8 @@
 
 INPUT
 MPZ
-        if (sv_derived_from($arg, \"Math::BigInt::GMP\")) {
-            IV tmp = SvIV((SV*)SvRV($arg));
-            $var = INT2PTR($type, tmp);
-        }
-        else
-            croak(\"$var is not of type Math::BigInt::GMP\")
+        $var = mpz_from_sv($arg);
 
 OUTPUT
 MPZ
-	sv_setref_pv($arg, \"Math::BigInt::GMP\", INT2PTR(void*, $var));
+        $arg = sv_from_mpz($var);




More information about the Pkg-perl-cvs-commits mailing list