Re: Replacing malloc with alloca.

2015-09-14 Thread Jeff Law
On 09/14/2015 02:14 AM, Richard Earnshaw wrote: On 13/09/15 20:19, Florian Weimer wrote: * Jeff Law: On 09/13/2015 12:28 PM, Florian Weimer wrote: * Ajit Kumar Agarwal: The replacement of malloc with alloca can be done on the following analysis. If the lifetime of an object does not stretc

Re: Replacing malloc with alloca.

2015-09-14 Thread Marc Glisse
On Sun, 13 Sep 2015, Ajit Kumar Agarwal wrote: The replacement of malloc with alloca can be done on the following analysis. If the lifetime of an object does not stretch beyond the immediate scope. In such cases the malloc can be replaced with alloca. This increases the performance to a great

Re: Replacing malloc with alloca.

2015-09-14 Thread Richard Earnshaw
On 13/09/15 20:19, Florian Weimer wrote: > * Jeff Law: > >> On 09/13/2015 12:28 PM, Florian Weimer wrote: >>> * Ajit Kumar Agarwal: >>> The replacement of malloc with alloca can be done on the following analysis. If the lifetime of an object does not stretch beyond the immediat

Re: Replacing malloc with alloca.

2015-09-13 Thread Florian Weimer
* Jeff Law: > On 09/13/2015 12:28 PM, Florian Weimer wrote: >> * Ajit Kumar Agarwal: >> >>> The replacement of malloc with alloca can be done on the following >>> analysis. >>> >>> If the lifetime of an object does not stretch beyond the immediate >>> scope. In such cases the malloc can be replace

Re: Replacing malloc with alloca.

2015-09-13 Thread Jeff Law
On 09/13/2015 12:28 PM, Florian Weimer wrote: * Ajit Kumar Agarwal: The replacement of malloc with alloca can be done on the following analysis. If the lifetime of an object does not stretch beyond the immediate scope. In such cases the malloc can be replaced with alloca. This increases the p

Re: Replacing malloc with alloca.

2015-09-13 Thread Florian Weimer
* Ajit Kumar Agarwal: > The replacement of malloc with alloca can be done on the following > analysis. > > If the lifetime of an object does not stretch beyond the immediate > scope. In such cases the malloc can be replaced with alloca. This > increases the performance to a great extent. You als