On Mon, Jan 16, 2012 at 3:11 PM, Joel C. Salomon <joelcsalomon@gmail.com> wrote:
On 01/16/2012 02:03 PM, Bakul Shah wrote:
> On Jan 16, 2012, at 10:51 AM, Greg Comeau <comeauat9fans@gmail.com> wrote:
>> What we do in problematic cases with Comeau is to generate code to
>> arrange for the allocation of the VLA on the heap.  I'm not saying
>> this is perfect, but at least it gets the feature implementable and up
>> and running as "a portable implementation" versus perhaps not being
>> able to implement it at all on some platforms.
>
> How do you deal with longjmp?

I recall reading the source for a (mostly-) portable alloca() that
checked where on the call-stack is was invoked from and released memory
for any alloca() invocation from lower on the stack.  (The allocations
themselves were on the heap.)

We do some analogous book keeping as well.

--
Greg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
World Class Compilers:  Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?