Alloca() and friends

Scott Schwartz schwartz at swatsun.uucp
Mon Jun 6 11:29:43 AEST 1988


In article <8017 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>For a limited class of applications, alloca() can be useful.
>However, I don't use it myself.  My applications all use a more
>disciplined approach to memory allocation.

One nice C extension that gcc provides is variable sized automatic
arrays. I.e.
	foo(s)
	int s;
	{
		int a[s];
	}

I think this obviates the need for alloca() in most (all?) cases.
Too late to get it in ansi, I suppose.

-- 
Scott Schwartz,  schwartz at swarthmore.edu,  psuvax1!vu-vlsi!swatsun!schwartz



More information about the Comp.lang.c mailing list