back to the (ivory) tower

gwyn at brl-smoke.UUCP gwyn at brl-smoke.UUCP
Sun Jun 5 08:10:49 AEST 1988


In article <16018 at brl-adm.ARPA> ted%nmsu.csnet at relay.cs.net writes:
>What is the opinion of the masses?  Is alloca really such a problem
>across differing architectures?  Is it really that useful?

Yes, alloca() simply cannot be reasonably implemented on a large
class of C implementations (notably, those with linked procedure
context frames instead of a single stack).  I published a public-
domain "mostly portable" version that works on all stack-based
implementations, but it uses malloc() for the allocation, not the
stack.  Many stack-based implementations do not supply much stack
space.  In fact, Gnu seems to provide my alloca() for use on
systems that don't come with their own.

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.



More information about the Comp.unix.wizards mailing list