From: Junio C Hamano Date: Thu, 14 Jun 2012 17:13:54 GMT Subject: Re: [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically Message-ID: <7vy5nperzh.fsf@alter.siamese.dyndns.org> In-Reply-To: <20099.6449254037$1339662032@news.gmane.org> y@imag.fr writes: > From: Matthieu Moy > > 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 > --- > > (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.