alloca(), #if, and other controversial things...
Larry Jones
scjones at sdrc.UUCP
Mon Aug 22 03:01:24 AEST 1988
Just to confuse the discussion further, what about machines / operating
systems which do not have a stack? It is perfectly reasonable to support
recursion by explicitly allocating heap memory to hold local variables on
entry to the function and freeing it on exit. To support alloca in this
type of system requires reallocating the block (which may mean allocating
a new, bigger block and copying the old block into it, except that would
screw up pointers...) or maintaining a linked list of blocks. Seems like
an awful lot of overhead to avoid writing a couple of calls to free().
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC scjones at sdrc
2000 Eastman Dr. BIX: ltl
Milford, OH 45150 AT&T: (513) 576-2070
Nancy Reagan on superconductivity: "Just say mho."
More information about the Comp.lang.c
mailing list