alloca is bad?

Eli Zaretskii eliz@delorie.com
Fri Nov 10 23:34:00 GMT 2000


> Date: Sat, 11 Nov 2000 17:06:19 +1100
> From: Andrew Cagney <ac131313@cygnus.com>
> 
> 	o	total stack bound of <2mb

The default stack size of DJGPP programs is 512KB.  It is allocated at
startup time in its entirety, and cannot be changed while the program
runs.

If we want to be more defensive against possible stack overflows due
to alloca, we need to use getrlimit.

In any case, we should be able to define some maximum size that is
allowed to be used with alloca, and write it up in the coding
standards.  Then code accept/reject criteria are no longer arbitrary,
they are corporate policy ;-)


More information about the Gdb mailing list