Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!rice!sun-spots-request
From: mjk@puffed.rice.edu (Mark J. Kilgard)
Newsgroups: comp.sys.sun
Subject: Alloca Implementation
Keywords: Miscellaneous
Message-ID: <1634@brazos.Rice.edu>
Date: 24 Sep 89 00:43:05 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 21
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 131, message 7 of 11

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