Alloca Implementation

Mark J. Kilgard mjk at puffed.rice.edu
Sun Sep 24 10:43:05 AEST 1989


The header for alloca, ie. /usr/lib/alloca.h reads as follows:

/*      @(#)alloca.h    1.3     88/02/07        SMI     */
#if defined(sparc)
# define alloca(x) __builtin_alloca(x)
#endif

Why?

It seems very strange to me that alloca is implemented this way.  Is Sun
just trying to be annoying, or is there a purpose.  alloca is in libc.a on
a Sun3.  In libc.a, alloca is no where to be found.  But __builtin_alloca
is.  

I had thought maybe alloca was implemented inline on a Sparc and maybe
this was a some kind of justification but that doesn't seem to be the
case.

  Mark Kilgard
  Rice University
  <mjk at rice.edu>



More information about the Comp.sys.sun mailing list