Path: utzoo!attcan!uunet!mcvax!jack From: jack@cwi.nl (Jack Jansen) Newsgroups: comp.unix.wizards Subject: Re: back to the (ivory) tower Message-ID: <367@piring.cwi.nl> Date: 11 Jun 88 15:00:52 GMT References: <16018@brl-adm.ARPA> <1121@X.UUCP> Organization: AMOEBA project, CWI, Amsterdam Lines: 17 I think alloca() should be implementable on all architectures, even those with a 'virtual stackpointer' (i.e. those where the compiler knows that the stackpointer will always be fp+NNN (or the other way around, for that matter)). I trick I once used was to allocate the memory on the heap, allocate two extra words, use one of them to build a linked list of all alloca-blocks within the scope and (here comes the trick) store the original return address in the other one, and replace the return address by the address of a routine that will free alloca() blocks and then really return. The only problem is setjump/longjump, but these can probably be massaged to handle the alloca blocks. -- Jack Jansen, jack@cwi.nl (or jack@mcvax.uucp) The shell is my oyster.