Re: [E-devel] [e] [PATCH] Small optimizations...

2012-12-19 Thread Gustavo Sverzut Barbieri
>From the patch it seems that the called "dangling" pointers shouldn't be used anymore, then it is correct to leave them like that. If you still use them, valgrind will warn. things like: + free(eth->file); + free(eth->key); free(eth); the fil

Re: [E-devel] [e] [PATCH] Small optimizations...

2012-12-19 Thread Leandro Dorileo
On Wed, Dec 19, 2012 at 04:24:13PM +, Michael Blumenkrantz wrote: > On Wed, Dec 19, 2012 at 4:20 PM, Leandro Dorileo > wrote: > > > Hi Maxime, > > > > On Wed, Dec 19, 2012 at 03:07:13PM +0100, Maxime Villard wrote: > > > Hi, > > > here is a patch. > > > > > > 1. free() already null-checks the

Re: [E-devel] [e] [PATCH] Small optimizations...

2012-12-19 Thread Michael Blumenkrantz
On Wed, Dec 19, 2012 at 4:20 PM, Leandro Dorileo wrote: > Hi Maxime, > > On Wed, Dec 19, 2012 at 03:07:13PM +0100, Maxime Villard wrote: > > Hi, > > here is a patch. > > > > 1. free() already null-checks the passed argument, so it is not > >necessary to do 'if(x) free(x)'. > > > Isn't that rea

Re: [E-devel] [e] [PATCH] Small optimizations...

2012-12-19 Thread Leandro Dorileo
Hi Maxime, On Wed, Dec 19, 2012 at 03:07:13PM +0100, Maxime Villard wrote: > Hi, > here is a patch. > > 1. free() already null-checks the passed argument, so it is not >necessary to do 'if(x) free(x)'. Isn't that reasoneable to replace if (x) free(x) by E_FREE(x)? Regards. > > 2. Mo

Re: [E-devel] [e] [PATCH] Small optimizations...

2012-12-19 Thread Michael Blumenkrantz
in On Wed, Dec 19, 2012 at 2:07 PM, Maxime Villard wrote: > Hi, > here is a patch. > > 1. free() already null-checks the passed argument, so it is not >necessary to do 'if(x) free(x)'. > > 2. Moved some '{free(x); x = NULL}' to E_FREE. > > 3. In e_start_main.c, 'buf' is allocated with the si

[E-devel] [e] [PATCH] Small optimizations...

2012-12-19 Thread Maxime Villard
Hi, here is a patch. 1. free() already null-checks the passed argument, so it is not necessary to do 'if(x) free(x)'. 2. Moved some '{free(x); x = NULL}' to E_FREE. 3. In e_start_main.c, 'buf' is allocated with the size of the two arguments + '=', so we don't need to check for lenght; w