back to the (ivory) tower

ted%nmsu.csnet at relay.cs.net ted%nmsu.csnet at relay.cs.net
Sun Jun 5 05:56:46 AEST 1988


The 4.3 manual entry for alloca says:

    BUGS
         Alloca is both machine- and compiler-dependent; its  use  is
         discouraged.

On the other hand, alloca is often used and strongly supported by the
gnu camp (n.b. heavy use in emacs and bison).

It is true that proper use does simplify many aspects of avoiding hard
limits for things like line lengths and such.  Alloca is also very
handy in implementing stack gaps so that setjmp/longjmp can be used to
do a weak implementation of coroutines and lightweight processes.

It is also true that alloca is almost trivial to implement on most
machines (say with a macro which expands to a single machine
instruction to in(de)crement the stack pointer).

What is the opinion of the masses?  Is alloca really such a problem
across differing architectures?  Is it really that useful?



More information about the Comp.unix.wizards mailing list