git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2012, 17:13 UTC
Message-ID
<7vy5nperzh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20099.6449254037$1339662032@news.gmane.org>
y@imag.fr writes:
Show 25 quoted lines
> From: Matthieu Moy <Matthieu.Moy@imag.fr>
>
> 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@imag.fr>
> ---
>
> (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.
Previous: y@imag.frNext: y@imag.fr
Message 4 of 8 in “What's cooking in git.git (Jun 2012, #03; Wed, 13)”
  1. Junio C HamanoJun 13, 2012
  2. lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13))Matthieu Moy, Jun 14, 2012
  3. 1/2 fixup! 8e00b48 don't allocate struct wt_status_state dynamicallyy@imag.fr, Jun 14, 2012
  4. Junio C HamanoJun 14, 2012
  5. 1/2 fixup! 8e00b48 don't allocate struct wt_status_state dynamicallyy@imag.fr, Jun 14, 2012
  6. 2/2 fixup! 38388c8 reword message when splitting a commit.y@imag.fr, Jun 14, 2012
  7. 2/2 fixup! 38388c8 reword message when splitting a commit.y@imag.fr, Jun 14, 2012
  8. Matthieu MoyJun 14, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.