bug-bison
[Top][All Lists]
Advanced

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

Re: GNU Bison #define YYSTACK_ALLOC_MAXIMUM


From: Paul Eggert
Subject: Re: GNU Bison #define YYSTACK_ALLOC_MAXIMUM
Date: Wed, 27 Apr 2005 16:01:37 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

address@hidden writes:

> The `#define YYSTACK_ALLOC_MAXIMUM 4032' reasonable?

It's our best guess for typical architectures.

Some architectures don't have reliable stack-overflow detection.  For
them, no definition will work in general.  But for the ones we know
about that have semi-reliable stack-overflow detection, the above
value works.

Ideally the archtitecture would detect all stack overflows reliably,
and we wouldn't have to worry about this at all.  But such machines
are rare in practice, unfortunately.

> Depends on the malloc() in gnulib/lib/alloca.c or the
> internal compiler-alloca implementation too.
> And on what the clib malloc() actually is allocating.

Absolutely.  There are a lot of details here.  Some I'm not even privy
to (on proprietary architectures).

> Could change it into this: (64 because of alignment in alloca)
>  #   define YYSTACK_ALLOC_MAXIMUM 4096-64 /* reasonable circa 2005 */

It's not a stack-alignment issue, really; it's just a fudge factor.

> Is there some written what the GNU Bison yacc.c parser
> driver actually ever might use on memory during runtime ?

No, the only thing written down is what is in yacc.c.
(We don't keep secret internal documentation....)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]