alloca(), #if, and other controversial things...

Leslie Mikesell les at chinet.UUCP
Tue Aug 23 08:41:17 AEST 1988


In article <355 at sdrc.UUCP> scjones at sdrc.UUCP (Larry Jones) writes:
>
>Just to confuse the discussion further, what about machines / operating
>systems which do not have a stack? 
  [ description deleted]
>.....  Seems like
>an awful lot of overhead to avoid writing a couple of calls to free().

Well, your description of the thing you wish to avoid pretty much fits
the way malloc() usually works.  But the real problem is that to make
those calls to free() you must unwind the stack under all conditions.
If the memory is released like automatic variables, you can longjmp()
out of a signal handler or a lower level function and get back to a
known condition.

Les Mikesell



More information about the Comp.lang.c mailing list