Jeroen Demeyer on Tue, 20 Jan 2015 16:31:25 +0100

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

Stack size bugs and parisizemax

Hello pari-dev,

At the atelier you mentioned that it shouldn't hurt to set a small parisize but a large parisizemax. In the light of this, bugs where some computation is much slower with a small parisize are more serious.

I think there should be some general solution to this problem which takes into account the value of parisizemax. The idea should be: do not collect garbage too often if instead we can increase parisize.

For this reason, I'm not completely happy with
25b0af6b8510e5b2feaa0d47fababa2fd25921e0. My proposal would be: if parisize < parisizemax, then call gerepileall() at most once per outer loop iteration. Something like:

for (...) /* outer loop */
  int gc_allowed = 1;
  for (...) /* inner loop */
    if (gc_allowed && gc_needed(...))
      gc_allowed = (parisize == parisizemax);