Ilya Zakharevich on Mon, 7 Apr 2003 14:14:39 -0700

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

Re: GMP kernel and stack abuse

On Mon, Apr 07, 2003 at 12:24:02PM +0200, Bill Allombert wrote:
> I think it is in the FAQ:

In my experience, it is easier to fix such problems than again and
again point to faq.

>   Using the GMP kernel, my session dies on a huge division!
>    This is a general problem in GMP, which may allocate a huge amount of
>    memory in the process stack space (using alloca). The best solution so far
>    is to increase the maximum size of the process stack segment before
>    starting gp from the shell. Alternatively, you might wish to configure GMP
>    with
>      configure --enable-alloca=malloc-noreentrant
>    but this will slow down GMP.

We *know* the stack limit.  Why not use this knowledge to substitute
our alloca()?