[Gmp-commit] /var/hg/gmp-5.0: refmpn_mul: conservative allocations.

mercurial at gmplib.org mercurial at gmplib.org
Sat Feb 4 18:17:02 CET 2012


details:   /var/hg/gmp-5.0/rev/fcf383f91b07
changeset: 13542:fcf383f91b07
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Feb 04 18:16:56 2012 +0100
description:
refmpn_mul: conservative allocations.

diffstat:

 ChangeLog      |  6 ++++--
 tests/refmpn.c |  6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r a376653e5f98 -r fcf383f91b07 ChangeLog
--- a/ChangeLog	Fri Feb 03 23:26:55 2012 +0100
+++ b/ChangeLog	Sat Feb 04 18:16:56 2012 +0100
@@ -1,7 +1,9 @@
+2012-02-04 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* tests/refmpn.c (refmpn_mul): More conservative allocations.
+
 2012-02-03  Torbjorn Granlund  <tege at gmplib.org>
 
-	* Version 5.0.4 released.
-
 	* mpn/x86_64/bd1/gmp-mparam.h: New file.
 
 	* longlong.h (udiv_qrnnd from sdiv_qrnnd): Declare udiv_w_sdiv.
diff -r a376653e5f98 -r fcf383f91b07 tests/refmpn.c
--- a/tests/refmpn.c	Fri Feb 03 23:26:55 2012 +0100
+++ b/tests/refmpn.c	Sat Feb 04 18:16:56 2012 +0100
@@ -1488,21 +1488,21 @@
   if (vn < TOOM4_THRESHOLD)
     {
       /* In the mpn_toom33_mul range, use mpn_toom22_mul.  */
-      tn = 2 * vn + mpn_toom22_mul_itch (vn, vn);
+      tn = 3 * vn + mpn_toom22_mul_itch (vn, vn);
       tp = refmpn_malloc_limbs (tn);
       mpn_toom22_mul (tp, up, vn, vp, vn, tp + 2 * vn);
     }
   else if (vn < FFT_THRESHOLD)
     {
       /* In the mpn_toom44_mul range, use mpn_toom33_mul.  */
-      tn = 2 * vn + mpn_toom33_mul_itch (vn, vn);
+      tn = 3 * vn + mpn_toom33_mul_itch (vn, vn);
       tp = refmpn_malloc_limbs (tn);
       mpn_toom33_mul (tp, up, vn, vp, vn, tp + 2 * vn);
     }
   else
     {
       /* Finally, for the largest operands, use mpn_toom44_mul.  */
-      tn = 2 * vn + mpn_toom44_mul_itch (vn, vn);
+      tn = 3 * vn + mpn_toom44_mul_itch (vn, vn);
       tp = refmpn_malloc_limbs (tn);
       mpn_toom44_mul (tp, up, vn, vp, vn, tp + 2 * vn);
     }


More information about the gmp-commit mailing list