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

Re: [PATCH] commit: fix "author_ident" leak

From
Junio C Hamano <gitster@pobox.com>
Date
May 18, 2022, 16:30 UTC
Message-ID
<xmqqtu9mx0p7.fsf@gitster.g>
In-Reply-To
<220517.86fsl86z1s.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> But even accounting for that, I don't see what the "more maintainable"
> here refers to. The approach I suggested would s/UNLEAK/strbuf_release/
> in the 4th hunk, but otherwise be equivalent.

Judicious use of UNLEAK() has documentation value to tell readers which use of pointer variables need to be explicitly released, and which pointer variables can just implicitly released by going out of scope at the end. There are also a few other small added benefits (they do not have to be changed when the helper needed to do the real release changes, and not doing an explicit real release on resources when there no need to is conceptually cleaner). But they are icing on the cake.

Sorry for a late reply---I go offline every other Tuesday and yesterday was such a Tuesday.

Previous: Ævar Arnfjörð Bjarmason
Message 12 of 12 in “commit: trivial leak fix, add 2 tests to linux-leaks CI”
  1. 0/2 commit: trivial leak fix, add 2 tests to linux-leaks CIÆvar Arnfjörð Bjarmason, Feb 16, 2022
  2. 1/2 commit: fix "author_ident" leakÆvar Arnfjörð Bjarmason, Feb 16, 2022
  3. Junio C HamanoFeb 16, 2022
  4. 2/2 commit: use strbuf_release() instead of UNLEAK()Ævar Arnfjörð Bjarmason, Feb 16, 2022
  5. Junio C HamanoFeb 16, 2022
  6. Junio C HamanoFeb 16, 2022
  7. Whether to keep using UNLEAK() in built-ins (was: [PATCH 2/2] commit: use strbuf_release() instead of UNLEAK())Ævar Arnfjörð Bjarmason, Feb 18, 2022
  8. Junio C HamanoFeb 18, 2022
  9. Ævar Arnfjörð BjarmasonFeb 18, 2022
  10. commit: fix "author_ident" leakJunio C Hamano, May 12, 2022
  11. Ævar Arnfjörð BjarmasonMay 17, 2022
  12. Junio C HamanoMay 18, 2022

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.