Re: [LEDE-DEV] [PATCH] procd: Remove unnecessary memset calls.

2017-11-12 Thread Eric Luehrsen
On 11/12/2017 10:53 PM, ros...@gmail.com wrote: Tested compile size difference. Saves 32 bytes. ¯\_(ツ)_/¯ On Tue, 2017-11-07 at 12:05 -0800, Rosen Penev wrote: Changes allocation to calloc and {} as needed. Signed-off-by: Rosen Penev --- inittab.c | 6 ++ plug/hotplug.c | 7 ++

Re: [LEDE-DEV] [PATCH] procd: Remove unnecessary memset calls.

2017-11-12 Thread rosenp
Tested compile size difference. Saves 32 bytes. ¯\_(ツ)_/¯ On Tue, 2017-11-07 at 12:05 -0800, Rosen Penev wrote: > Changes allocation to calloc and {} as needed. > > Signed-off-by: Rosen Penev > --- > inittab.c | 6 ++ > plug/hotplug.c | 7 ++- > 2 files changed, 4 insertions(+), 9

Re: [LEDE-DEV] [PATCH] procd: Remove unnecessary memset calls.

2017-11-08 Thread Paul Oranje
Thanks, also for the link (https://vorpus.org/blog/why-does-calloc-exist/). This article made me aware that using calloc() may be wise. For security reasons: calloc avoids possible arrhythmic overflows when the allocation size for malloc is the product of two numbers. And because it may offer re

Re: [LEDE-DEV] [PATCH] procd: Remove unnecessary memset calls.

2017-11-08 Thread rosenp
On Wed, 2017-11-08 at 11:57 +0100, Paul Oranje wrote: > Both memset() and calloc() have highly optimised implementations, so > the expected gains with this patch for the allocation of zeroed > memory will be small at best. As this patch does not fix a bug: why > is the change "needed" ? > Style ch

Re: [LEDE-DEV] [PATCH] procd: Remove unnecessary memset calls.

2017-11-08 Thread Paul Oranje
Both memset() and calloc() have highly optimised implementations, so the expected gains with this patch for the allocation of zeroed memory will be small at best. As this patch does not fix a bug: why is the change "needed" ? Just curiosity, bye, Paul > Op 7 nov. 2017, om 21:05 heeft Rosen Pene

[LEDE-DEV] [PATCH] procd: Remove unnecessary memset calls.

2017-11-07 Thread Rosen Penev
Changes allocation to calloc and {} as needed. Signed-off-by: Rosen Penev --- inittab.c | 6 ++ plug/hotplug.c | 7 ++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/inittab.c b/inittab.c index 21172f7..c27c324 100644 --- a/inittab.c +++ b/inittab.c @@ -284,8 +284,7