Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cbmvax!cbmehq!cbmdeo!lenler!moria!bojsen From: bojsen@moria.UUCP (Per Bojsen) Newsgroups: comp.sys.amiga.programmer Subject: Re: AmigaGCC stack hogging Keywords: GNU, alloca(), regex.c, alloca.c, gcc, g++ Message-ID: <18887df5.ARN1ad7@moria.UUCP> Date: 16 Jan 91 19:52:05 GMT References: <1882f287.ARN1979@moria.UUCP> <1991Jan14.212254.9779@csun.edu> Reply-To: bojsen@moria.UUCP Followup-To: comp.sys.amiga.programmer Organization: IDUN-Soft Aps. Lines: 27 In article <1991Jan14.212254.9779@csun.edu>, Stephen Walton writes: > In article <1882f287.ARN1979@moria.UUCP>, bojsen@moria (Per Bojsen) writes: > > >What is the precise reason for the large stack needs of GCC? > > This is not peculiar to GCC. All of the GNU software is written as if > the amount of available stack was essentially infinite. The GNU regular > expression routines, for instance, use alloca() extensively. > As I pointed out in my previous article, along with the GNU sed, flex, diff, and gawk Amiga ports followed a version of alloca() that does _not_ allocate on the stack, _but_ uses malloc()! The other day I just checked, and this alloca.c module is also included with the gcc-1.37.1 distribution. Using this special version of alloca() should make it possible to reduce the stack needs of the GNU utilities substantially, so my question stands: does the Amiga ports of gcc use this non-stack-allocating alloca(), or do they allocate _on_ the stack? -- .------------------------------------------------------------------------------. | Greetings from Per Bojsen. | +-------------------------------+----------------------------------------------+ | EMail: cbmehq!lenler!bojsen |"Zen is a feeling. It's the feeling you get | | Or: bojsen@dc.dth.dk | when you know you're going to get a feeling."| `-------------------------------+----------------------------------------------'