alloca vs var-len auto arrays

Kyle Jones kjones at talos.UUCP
Thu May 4 01:16:25 AEST 1989


>> Are there architectures that will not allow you to implement this?
>
> No, with compiler assist you can always implement it; but its
> complexity can approach that of marking all mallocs and teaching the
> compiler (and longjmp) to call un_malloc_temporaries on each procedure
> return.

It suffices to call un_malloc_temporaries at the end of functions that
actaully use alloca, and just after successful longjmp calls.  Even
without help from the compiler the wrappers are easy to implement and
portable.  But it's akin to having to explicitly reclaim space used by
local variables.  The implementation details may be different but the
concept is the same.



More information about the Comp.unix.wizards mailing list