alloca wars

David Dyer-Bennet ddb at ns.UUCP
Thu Aug 4 04:28:13 AEST 1988


In article <5422 at june.cs.washington.edu>, pardo at june.cs.washington.edu (David Keppel) writes:
$ During the last alloca war somebody suggested having alloca require
$ explicit "free" semantics, so that malloc-based (library) allocations
$ would be reasonable to write and work on shared-memory multiprocesors.
$ This would probably also hose fewer compilers/architectures.  If I
$ understand, code would look like:

$ 	:
$ 	foo = alloca( size );
$ 	:
$ 	afree( size );
$ 	return( value );

$ This complicates the code slightly, but (I believe) would give
$ everybody "the best of both worlds".  Does anybody object to these
$ semantics?

   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?
-- 
	-- David Dyer-Bennet
	...!{rutgers!dayton | amdahl!ems | uunet!rosevax}!umn-cs!ns!ddb
	ddb at Lynx.MN.Org, ...{amdahl,hpda}!bungia!viper!ddb
	Fidonet 1:282/341.0, (612) 721-8967 hst/2400/1200/300



More information about the Comp.lang.c mailing list