[Gmp-commit] /var/hg/gmp: Fix use of TMP_ALLOC in tuneup.c

mercurial at gmplib.org mercurial at gmplib.org
Sun Sep 15 06:46:46 UTC 2019


details:   /var/hg/gmp/rev/217337dadd8e
changeset: 17903:217337dadd8e
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Sun Sep 15 08:45:52 2019 +0200
description:
Fix use of TMP_ALLOC in tuneup.c

diffstat:

 gmp-impl.h    |  4 ++--
 tune/tuneup.c |  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r ed0b64412be7 -r 217337dadd8e gmp-impl.h
--- a/gmp-impl.h	Sat Sep 14 22:41:40 2019 +0200
+++ b/gmp-impl.h	Sun Sep 15 08:45:52 2019 +0200
@@ -341,10 +341,10 @@
    TMP_MARK was made, but then no TMP_ALLOCs.  */
 
 /* The alignment in bytes, used for TMP_ALLOCed blocks, when alloca or
-   __gmp_allocate_func doesn't already determine it.  Currently TMP_ALLOC
-   isn't used for "double"s, so that's not in the union.  */
+   __gmp_allocate_func doesn't already determine it.  */
 union tmp_align_t {
   mp_limb_t  l;
+  double     d;
   char       *p;
 };
 #define __TMP_ALIGN  sizeof (union tmp_align_t)
diff -r ed0b64412be7 -r 217337dadd8e tune/tuneup.c
--- a/tune/tuneup.c	Sat Sep 14 22:41:40 2019 +0200
+++ b/tune/tuneup.c	Sun Sep 15 08:45:52 2019 +0200
@@ -724,7 +724,7 @@
 
   TMP_DECL;
   TMP_MARK;
-  t = TMP_ALLOC (n * sizeof (*t));
+  t = (double*) TMP_ALLOC (n * sizeof (*t));
 
   for (i = 0; i < n; i++)
     {


More information about the gmp-commit mailing list