From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <4F14846C.4040706@gmail.com> References: <4F14846C.4040706@gmail.com> Date: Tue, 17 Jan 2012 14:31:48 -0500 Message-ID: From: Comeau At9Fans To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=e89a8f502a56e07c6504b6be6180 Subject: Re: [9fans] assembly syntax in plan 9 Topicbox-Message-UUID: 5e53fa00-ead7-11e9-9d60-3106f5b1d025 --e89a8f502a56e07c6504b6be6180 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jan 16, 2012 at 3:11 PM, Joel C. Salomon wrote: > On 01/16/2012 02:03 PM, Bakul Shah wrote: > > On Jan 16, 2012, at 10:51 AM, Greg Comeau > 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? --e89a8f502a56e07c6504b6be6180 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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. =A0I'm not = saying
>> this is perfect, but at least it gets the feature implementable an= d up
>> and running as "a portable implementation" versus perhap= s 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. =A0(The allocations themselves were on the heap.)

We do some an= alogous book keeping as well.

--
Greg Comeau / 4.3.= 10.1 with C++0xisms now in beta!
Comeau C/C++ ONLINE =3D=3D> = =A0 =A0 http://www.comeaucomputing.com/tryitout
World Class Compilers: =A0Breathtaking C++, Amazing C99, Fabulous C90.=
Comeau C/C++ with Dinkumware's Libraries... Have you tried i= t?

--e89a8f502a56e07c6504b6be6180--