One very serious danger with using alloca is that alloca interferes with 
tail-call
optimization. After debugging code using alloca a couple times, I would be 
really
hard pressed to every use alloca again.

On Saturday, February 23, 2019 at 6:24:24 AM UTC-5, Artyom Shalkhakov wrote:
>
> Hi Vanessa!
>
> On Saturday, February 23, 2019 at 1:11:31 PM UTC+2, Vanessa McHale wrote:
>>
>> Is there any way to safely use alloca in ATS? I know the language has 
>> features for both safe pointer arithmetic and safe use of 
>> stack-allocated variables... so it would be nice to both guarantee no
>> out-of-bounds array accesses and no subsequent uses of the pointer. 
>>
>>
> Have you seen this discussion:
>
>
> https://groups.google.com/forum/#!searchin/ats-lang-users/alloca%7Csort:date/ats-lang-users/a9KRqQn2uGo/nUqbI_2AHn4J
>
> As for me, I think It's OK to use the outlined approach. BTW it is already 
> provided in the ATS2 libats/libc.
>  
>>
>> Cheers, 
>> Vanessa McHale 
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/9d8b4dc7-5d0d-4dd4-9ed3-d36013462b98%40googlegroups.com.

Reply via email to