alloca wars

Dave Jones djones at megatest.UUCP
Fri Aug 5 06:40:57 AEST 1988


>From article <696 at ns.UUCP>, by ddb at ns.UUCP (David Dyer-Bennet):
> 
>    Well, the reasons why alloca is difficult to implement seem convincing.
> However, the only point I ever saw to alloca was the automatic deallocation
> on exit.  If you don't have that, what advantage is there over malloc or
> any of the standard allocation routines?
>

Speed.  The malloc() on in Sun3 OS, for example, is incredibly slow
after a few thousand blocks have been allocated.  As has been pointed
out, a memory allocation package built on a separate stack could
be used.  (But then you miss the automatic deallocation, of course.)


		-- djones



More information about the Comp.lang.c mailing list