Article View: gnu.misc.discuss
Article #75636Re: Why alloca()?
From: Greg A. Woods
Date: Sun, 27 May 1990 00:56
Date: Sun, 27 May 1990 00:56
29 lines
2135 bytes
2135 bytes
In article <26593D50.508E@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes:
> According to kyle@cs.odu.edu:
> >Portability needn't suffer, because portable substitutes for alloca()
> >exist, and these can be used on machines that don't support it.
>
> This analysis is incomplete. So-called "portable" alloca
> implementations are never faster than malloc(), since they call
> malloc() to do the actual allocation. So using alloca() is fast with
> some architecture+compiler combinations, it is actually slow with
> others.
Don't forget that most people probably refer to the GNU-emacs
implementation of alloca() when they refer to the "portable"
implementation. Unfortunately I've not yet been able to generate a
working version of this routine on my 3B2/400. (The WE32000 stack
grows upwards, but that knowledge doesn't seem to help much, and I've
not yet dis-assembled the libPW.a version to determine how it works.
The mere fact that the libPW.a version does work has been good enough
for now. Perhaps as I get further in porting gcc, I'll have to figure
the details out...)
I will stick my neck out and make the claim that all code which uses
alloca(), and in which such use cannot easily be removed, is
inherently poor in design and implementation.
--
Greg A. Woods
woods@{robohack,gate,eci386,tmsoft,ontmoh}.UUCP
+1 416 443-1734 [h] +1 416 595-5425 [w] VE3-TCP Toronto, Ontario; CANADA
Technical Details
Message-ID:
<1990May27.005655.22963@robohack.UUCP>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!news-server.csri.toronto.edu!torsqnt!tmsoft!robohack!woodsReferences:
<1990May19.044239.16031@egsner.cirr.com> <1990May21.133554.12832@talos.pm.com> <26593D50.508E@tct.uucp>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1025b4,57cdf436494e0ba9 X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1990-05-26 22:26:28 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cs.utexas.edu!news-server.csri.toronto.edu!torsqnt!tmsoft!robohack!woods From: woods@robohack.UUCP (Greg A. Woods) Newsgroups: gnu.misc.discuss Subject: Re: Why alloca()? Message-ID: <1990May27.005655.22963@robohack.UUCP> Date: 27 May 90 00:56:55 GMT References: <1990May19.044239.16031@egsner.cirr.com> <1990May21.133554.12832@talos.pm.com> <26593D50.508E@tct.uucp> Organization: R. H. Lathwell Associates: Elegant Communications, Inc. Lines: 29 Posted: Sun May 27 01:56:55 1990