git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] revision: clear decoration structs during release_revisions()
Date: Thu, 5 Oct 2023 20:51:32 -0400	[thread overview]
Message-ID: <20231006005132.GA992085@coredump.intra.peff.net> (raw)
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

  reply	other threads:[~2023-10-06  0:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05 21:28 [PATCH 0/3] a few more leak fixes Jeff King
2023-10-05 21:29 ` [PATCH 1/3] decorate: add clear_decoration() function Jeff King
2023-10-05 21:30 ` [PATCH 2/3] revision: clear decoration structs during release_revisions() Jeff King
2023-10-05 23:00   ` Junio C Hamano
2023-10-06  0:51     ` Jeff King [this message]
2023-10-06 16:42       ` Junio C Hamano
2023-10-05 21:33 ` [PATCH 3/3] daemon: free listen_addr before returning Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231006005132.GA992085@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).