Jeroen Demeyer on Thu, 14 Jan 2016 13:25:06 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PATCH] Guard stack size warnings with DEBUGMEM


Added the analogous guard also for parisizemax.
commit b5b243fb46cfaf2e0bab44a32a249793fd14fba9
Author: Jeroen Demeyer <jdemeyer@cage.ugent.be>
Date:   Thu Jan 14 10:13:39 2016 +0100

    Use DEBUGMEM for stack size warnings

diff --git a/src/language/init.c b/src/language/init.c
index a673cbc..c4b559c 100644
--- a/src/language/init.c
+++ b/src/language/init.c
@@ -722,7 +722,8 @@ parivstack_resize(ulong newsize)
   evalstate_reset();
   paristack_setsize(pari_mainstack->rsize, newsize);
   s = pari_mainstack->vsize ? pari_mainstack->vsize : pari_mainstack->rsize;
-  pari_warn(warner,"new maximum stack size = %lu (%.3f Mbytes)", s, s/1048576.);
+  if (DEBUGMEM > 0)
+    pari_warn(warner,"new maximum stack size = %lu (%.3f Mbytes)", s, s/1048576.);
   pari_init_errcatch();
   cb_pari_err_recover(-1);
 }
@@ -736,7 +737,8 @@ paristack_newrsize(ulong newsize)
     pari_mainstack_resize(pari_mainstack, newsize, vsize);
   evalstate_reset();
   s = pari_mainstack->rsize;
-  pari_warn(warner,"new stack size = %lu (%.3f Mbytes)", s, s/1048576.);
+  if (DEBUGMEM > 0)
+    pari_warn(warner,"new stack size = %lu (%.3f Mbytes)", s, s/1048576.);
   pari_init_errcatch();
   cb_pari_err_recover(-1);
 }
@@ -750,7 +752,8 @@ paristack_resize(ulong newsize)
   newsize = maxuu(minuu(newsize, vsize), pari_mainstack->size);
   pari_mainstack->size = newsize;
   pari_mainstack->bot = pari_mainstack->top - pari_mainstack->size;
-  pari_warn(warner,"increasing stack size to %lu",newsize);
+  if (DEBUGMEM > 0)
+    pari_warn(warner,"increasing stack size to %lu",newsize);
 }
 
 void