alloca usage

Kevin Ryde user42 at zip.com.au
Fri Nov 21 09:24:58 CET 2003


nisse at lysator.liu.se (Niels Möller) writes:
>
> Due to the way the "red zone" stack extension mechanism works, I don't
> think it's reliable to allocate more than a few pages of data on the
> stack at a time. If you allocate too many pages you may get a
> segmentation violation of you access the pages in an unfortunate
> order.

I think gcc -fstack-check can be used to force each page allocated to
be touched, which will tickle a redzone before any damage is done.
That option affects both __builtin_alloca and space for local
variables.


More information about the gmp-devel mailing list