alloca wars

Greg Onufer exodus at mfgfoc.UUCP
Sat Aug 6 02:52:18 AEST 1988


>From article <62721 at sun.uucp>, by swilson%thetone at Sun.COM (Scott Wilson):
> 1.)  Code that, in general, makes use of features that are less available
>      than others is, in general, less portable.
I don't feel alloca is such a big issue in portability... consider the GNU 
code.  Makes extensive use of alloca.  Works on quite a few machines too,
I'd say.

> 2.)  Alloca is less available than malloc/free.
On a M68k with a decent OS, alloca is not more than a few lines of assembly
code, correct?  (Judging by the size of the GNU assembly alloca)...
If one needs alloca and it is not available, why not write a quick alloca?
If the machine architecture or OS is braindamaged, then one would have
to program around it.  GNU does that also.

> 3.)  Therefore, all other things equal, code that uses alloca is less
>      portable than code that doesn't.
Not if the programmer cares that extra little bit.

> Does this make sense?
Does it?

-Greg
-- 
Greg Onufer   		GEnie: G.ONUFER		University of the Pacific
UUCP:						-= Focus Semiconductor =-
exodus at mfgfoc ...!sun!daver!mfgfoc!exodus  (and postmaster/exodus at uop.edu)
AT&T: 415-965-0604	USMAIL: #901 1929 Crisanto Ave, Mtn View, CA 94040 



More information about the Comp.lang.c mailing list