Re: [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically

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

 



y@xxxxxxx writes:

> From: Matthieu Moy <Matthieu.Moy@xxxxxxx>
>
> The common
>
> void function() {
> 	struct wt_status_state *state = calloc(...);
> 	...
> 	free(state);
> }
>
> is essentially a less efficient, and more error prone way of allocating a
> variable on the stack (plus, the calloc should have been a xcalloc).
> Replace it with an on-stack variable.
>
> While we're there, also replace the individual initializations of fields
> with memset(..., 0, ...).
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@xxxxxxx>
> ---
>
> (BTW, I didn't find a way to have both --autosquash-compliant and
> meaningfull titles)
>
>  wt-status.c | 49 +++++++++++++++++++++----------------------------
>  1 file changed, 21 insertions(+), 28 deletions(-)

Thanks; much better.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]