Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: scope of malloc Message-ID: <14516@megatest.UUCP> Date: 22 Nov 90 01:50:28 GMT References: <11631@alice.att.com> Organization: Megatest Corporation, San Jose, Ca Lines: 14 From article <11631@alice.att.com>, by ark@alice.att.com (Andrew Koenig): ... > For example, barring alloca() means that the compiler can always know > the size of the stack frame. That, in turn, means that it is possible > to maintain the stack using only a single pointer. That implies that > a function call need update only one stack register and not two. The Sun C compiler does alloca() properly, so far as I know, so it does not "know" the size of the stack frame at compile-time. Yet, not only does it maintain the stack using a single pointer, and the function call only updates one stack register, but if you don't call alloca(), the stack pointer is doesn't change until the procedure returns! It's all kind of clever the way it works. See the SPARC Architecture Manual, pg. 160.