[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Mar 19 17:21:02 CET 2011


details:   /var/hg/gmp/rev/13a997b0b111
changeset: 14068:13a997b0b111
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Mar 19 17:20:45 2011 +0100
description:
Use MPZ_REALLOC for standard, conditional reallocation.

details:   /var/hg/gmp/rev/cce6c818dea7
changeset: 14069:cce6c818dea7
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Mar 19 17:20:59 2011 +0100
description:
*** empty log message ***

diffstat:

 ChangeLog    |  5 +++++
 mpz/fac_ui.c |  6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r 798bd4a2cc41 -r cce6c818dea7 ChangeLog
--- a/ChangeLog	Sat Mar 19 09:10:43 2011 +0100
+++ b/ChangeLog	Sat Mar 19 17:20:59 2011 +0100
@@ -1,3 +1,8 @@
+2011-03-19  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpz/fac_ui.c (mpz_fac_ui): Use MPZ_REALLOC for standard, conditional
+	reallocation.
+
 2011-03-19  Niels Möller  <nisse at lysator.liu.se>
 
 	* mpn/generic/divrem_2.c (mpn_divrem_2): Fixed comment and assert
diff -r 798bd4a2cc41 -r cce6c818dea7 mpz/fac_ui.c
--- a/mpz/fac_ui.c	Sat Mar 19 09:10:43 2011 +0100
+++ b/mpz/fac_ui.c	Sat Mar 19 17:20:59 2011 +0100
@@ -145,14 +145,14 @@
 
   if (n <= ((unsigned long) 1) << (APCONST))
     {
-      mpz_realloc2 (x, 4 * z);
+      MPZ_REALLOC (x, 4 * z);
       ap_product_small (x, CNST_LIMB(2), CNST_LIMB(1), n - 1, 4L);
       return;
     }
   if (n <= ((unsigned long) 1) << (APCONST + 1))
     {				/*  use n!=odd(1,n)*(n/2)!*2^(n/2)         */
       mpz_init2 (t1, 2 * z);
-      mpz_realloc2 (x, 4 * z);
+      MPZ_REALLOC (x, 4 * z);
       ap_product_small (x, CNST_LIMB(2), CNST_LIMB(1), n / 2 - 1, 4L);
       ap_product_small (t1, CNST_LIMB(3), CNST_LIMB(2), (n - 1) / 2, 4L);
       mpz_mul (x, x, t1);
@@ -165,7 +165,7 @@
       /* use n!=C_2(1,n/2)^2*C_2(n/2,n)*(n/4)!*2^(n/2+n/4) all int divs
 	 so need (BITS_IN_N-APCONST+1)=(APCONST+3-APCONST+1)=4 stack entries */
       mpz_init2 (t1, 2 * z);
-      mpz_realloc2 (x, 4 * z);
+      MPZ_REALLOC (x, 4 * z);
       for (i = 0; i < 4; i++)
 	{
 	  mpz_init2 (st[i], z);


More information about the gmp-commit mailing list