k...@aspodata.se writes:
> Reiner Weikusat:
>> Peter Olson <pe...@peabo.com> writes:
>> 
>> >> On January 23, 2016 at 1:36 PM Rainer Weikusat
>> >> <rainerweiku...@virginmedia.com> wrote:
>> >> 
>> >> Peter Olson <pe...@peabo.com> writes:
>> >> 5>> On January 22, 2016 at 4:34 PM Rainer Weikusat
>> >> <rainerweiku...@virginmedia.com> wrote:
>> >> 
>> >> [...]
>> >> 
>> >> >>     p = buf = alloca(total);
>> >> 
>> >> [...]
>> >> 
>> >> >   the failure mode of alloca is SIGSEGV or some other malfunction and
>> >> > there is no way to test for it
>
> You should be able to cache a SIGSEGV if you are useing sigaltstack().
> Never tested it though and don't know it it is useful at all.
>
> ...
>> In this respect, there's no difference between alloca and static stack
>> allocations.
> ...
>
> Soo, the above is nearly the same as
>
>   char buf[total];
>   p = buf;
>
> Why then use alloca()?

This obviously cuts both ways: Considering that C99 style variable
arrays share all the (largely hypothetical) drawbacks of alloca but
offer less features, why use them?


_______________________________________________
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Reply via email to