Bill Allombert on Tue, 04 Apr 2017 11:03:35 +0200


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

Re: When enlarging stack in new_chunk_resize(), add 1/8 to stack size


On Tue, Apr 04, 2017 at 10:26:51AM +0200, Jeroen Demeyer wrote:
> On 2017-04-03 21:36, Bill Allombert wrote:
> >This increases the risk the random gc run in a tight loop.
> 
> Tight gc loops are bugs and should be fixed regardless. In the past, I have
> reported several such bugs already.

But it is difficult, because it is situational.

> >Maybe explain with word what behaviour you want to implement.
> 
> First of all, I never liked the stack doubling because it could lead to
> needless failures. Imagine for example that the stack is 4G and that 6G is
> available in total. With the old code, the doubling would fail and the stack
> would never be larger than 4G even if 6G is available. By increasing the
> stack in smaller pieces, this problem is avoided.

Did it actually happen ?
I tried this with PARI 2.9.1 and I get:

? default(parisizemax,24M)
  ***   Warning: new maximum stack size = 24002560 (22.891 Mbytes).
? polmodular(101)
  *** polmodular: Warning: increasing stack size to 16000000.
  *** polmodular: Warning: increasing stack size to 24002560.

Cheers,
Bill.