Path: utzoo!utgpu!attcan!uunet!husc6!rutgers!ucsd!ucbvax!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: alloca wars Message-ID: <697@goofy.megatest.UUCP> Date: 4 Aug 88 20:40:57 GMT References: <696@ns.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 15 From article <696@ns.UUCP>, by ddb@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