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

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


details:   /var/hg/gmp/rev/df65087c30f2
changeset: 14605:df65087c30f2
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Feb 04 18:22:13 2012 +0100
description:
refmpn_mul: conservative allocations.

diffstat:

 ChangeLog      |  4 ++++
 tests/refmpn.c |  8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r 44083fea3ee4 -r df65087c30f2 ChangeLog
--- a/ChangeLog	Fri Feb 03 15:51:26 2012 +0100
+++ b/ChangeLog	Sat Feb 04 18:22:13 2012 +0100
@@ -1,3 +1,7 @@
+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>
 
 	* longlong.h (udiv_qrnnd from sdiv_qrnnd): Declare udiv_w_sdiv.
diff -r 44083fea3ee4 -r df65087c30f2 tests/refmpn.c
--- a/tests/refmpn.c	Fri Feb 03 15:51:26 2012 +0100
+++ b/tests/refmpn.c	Sat Feb 04 18:22:13 2012 +0100
@@ -2,7 +2,7 @@
    of the normal gmp code.  Speed isn't a consideration.
 
 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -1881,21 +1881,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