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

Re: [PATCH 2/3] revision: clear decoration structs during release_revisions()

From
Jeff King <peff@peff.net>
Date
Oct 6, 2023, 00:51 UTC
Message-ID
<20231006005132.GA992085@coredump.intra.peff.net>
In-Reply-To
<xmqq34yoekt5.fsf@gitster.g>
On Thu, Oct 05, 2023 at 04:00:54PM -0700, Junio C Hamano wrote:
> Wow, nested maze of callbacks make my head spin ;-) but they all
> look reasonable.  Thanks.
Yeah, I don't love those one-liner callbacks just to handle the cast.

The other alternative is to write some kind of for_each_decoration() macro, but I think it ends up in the usual macro hell (requiring the caller to provide iterator variables, hanging half-open braces, and so on). It might be worth it if iterating could be used in other places, but I don't think it is.

So I tried to choose the lesser of two evils. :)
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “a few more leak fixes”
  1. 0/3 a few more leak fixesJeff King, Oct 5, 2023
  2. 1/3 decorate: add clear_decoration() functionJeff King, Oct 5, 2023
  3. 2/3 revision: clear decoration structs during release_revisions()Jeff King, Oct 5, 2023
  4. Junio C HamanoOct 5, 2023
  5. Jeff KingOct 6, 2023
  6. Junio C HamanoOct 6, 2023
  7. 3/3 daemon: free listen_addr before returningJeff King, Oct 5, 2023

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.