In article <fqk1tl$oco$> Andrey Tarasevich <> writes:
> Eric Sosman wrote:
....
> > It's not obvious to me, but I've used fewer than fifty
> > C implementations and my experience may not be as broad as
> > yours. How many implementations did you study before
> > reaching your conclusion?
>
> I don't exactly understand why you seem to assume that my conclusion is
> supposed to be based specifically on "studying implementations". I already
> explained that my conclusion is based solely on the fact of the existence
> of VLAs. I already commented the differences between VLAs and 'alloca'.
> Exhaustively, in my opinion.
There are differences that make VLAs more easy to implement on some systems.
Consider a system where the stack is used only to contain stuff used for
function entry (and is actually a stack, because the size used for entry
is the same for *every* function). Local variables are allocated in some
way from the heap. The function *knows* how much to deallocate when the
function exits, it is also able to find out how much to deallocate for
VLAs.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland;
http://www.cwi.nl/~dik/