Re: [PATCH v10] git: use calloc instead of malloc + memset where possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"AreaZR via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> From: Seija Kijin <doremylover123@xxxxxxxxx>
>
> Avoid calling malloc + memset by calling calloc.
>
> Signed-off-by: Seija <doremylover123@xxxxxxxxx>

Name mismatch.

>  remote.c    |  4 ++--
>  submodule.c | 10 +++++-----
>  2 files changed, 7 insertions(+), 7 deletions(-)

I somehow hoped to see that this shrinks the line count, as you are
essentially replacing two calls (malloc + memset) with one, but that
is not what is happening, which is a bit disapointing.

But this is a strict improvement, I guess.  The reader needs to be
familiar with the CALLOC_ARRAY() macro to understand it, which may
make the code less newbie-friendly (as opposed to malloc+memset any
reasonably competent C programmer would understand without any prior
knowledge of the conventions used by this project).





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux