Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!xanth!mcnc!rti!talos!kjones From: kjones@talos.UUCP (Kyle Jones) Newsgroups: comp.unix.wizards Subject: alloca vs var-len auto arrays Message-ID: <519@talos.UUCP> Date: 3 May 89 15:16:25 GMT Reply-To: kjones@talos.UUCP (Kyle Jones) Organization: Philip Morris Research Center, Richmond, VA Lines: 13 >> 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.