Torbjorn Granlund <tege@swox.com> writes: > > Some work will also be needed at the mpz level to reduce stack > allocation. But we should start at the mpn level, I think. What did you think of the idea to have all TMP_ALLOC calls check the size they're asked for and use malloc above a threshold? That'd uniformly avoid big blocks and mean a fixed maximum stack usage for any given function.