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

Re: [PATCH 08/11] checkout: add a missing clear_unpack_trees_porcelain()

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 30, 2022, 23:45 UTC
Message-ID
<xmqqzghtaf6u.fsf@gitster.g>
In-Reply-To
<220701.86wncxbu7q.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 14 quoted lines
>> Does refresh_cache(REFRESH_QUIET) depend on the porcelain error
>> messages already set?  If not another way to fix it may be to delay
>> the call to setup_unpack_trees_porcelain() until it becomes needed.
>>
>> But the patch as posted is certainly an improvement.
>
> Yes, that would work too, I can do it that way if you'd like.
>
> I was trying to keep these fixes as narrow as possible, and resist any
> temptations to re-arrange code so as to avoid allocations, which we can
> often do, but then instead of a 1-line diff it's 10, 50, 100... :)
>
> In this case it'll be somewhere around 10, and just a code-move, so
> maybe that's fine...
The ideal answer I was hoping to hear was
    The current implementation of the refresh_cache() function might
    not, but there is no guarantee that it will stay so.  We may add
    more calls that may (or may not) need to access the error
    message table before this early return.  Setting the porcelain
    messages before making any calls to any functions in the API and
    unsetting after we are done is a much better code structure.
;-)
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 14 of 31 in “built-ins: fix common memory leaks”
  1. 00/11 built-ins: fix common memory leaksÆvar Arnfjörð Bjarmason, Jun 30, 2022
  2. 01/11 check-ref-format: fix trivial memory leakÆvar Arnfjörð Bjarmason, Jun 30, 2022
  3. Junio C HamanoJun 30, 2022
  4. 02/11 clone: fix memory leak in copy_ref() callÆvar Arnfjörð Bjarmason, Jun 30, 2022
  5. Junio C HamanoJun 30, 2022
  6. 03/11 submodule.c: free() memory from xgetcwd()Ævar Arnfjörð Bjarmason, Jun 30, 2022
  7. 04/11 revert: free "struct replay_opts" membersÆvar Arnfjörð Bjarmason, Jun 30, 2022
  8. 05/11 cat-file: fix a memory leak in --batch-command modeÆvar Arnfjörð Bjarmason, Jun 30, 2022
  9. 06/11 merge-file: refactor for subsequent memory leak fixÆvar Arnfjörð Bjarmason, Jun 30, 2022
  10. 07/11 merge-file: fix memory leaks on error pathÆvar Arnfjörð Bjarmason, Jun 30, 2022
  11. 08/11 checkout: add a missing clear_unpack_trees_porcelain()Ævar Arnfjörð Bjarmason, Jun 30, 2022
  12. Junio C HamanoJun 30, 2022
  13. Ævar Arnfjörð BjarmasonJun 30, 2022
  14. Junio C HamanoJun 30, 2022
  15. 09/11 gc: fix a memory leakÆvar Arnfjörð Bjarmason, Jun 30, 2022
  16. 10/11 cat-file: fix a common "struct object_context" memory leakÆvar Arnfjörð Bjarmason, Jun 30, 2022
  17. 11/11 pull: fix a "struct oid_array" memory leakÆvar Arnfjörð Bjarmason, Jun 30, 2022
  18. 00/11 built-ins: fix common memory leaksÆvar Arnfjörð Bjarmason, Jul 1, 2022
  19. 01/11 check-ref-format: fix trivial memory leakÆvar Arnfjörð Bjarmason, Jul 1, 2022
  20. 02/11 clone: fix memory leak in wanted_peer_refs()Ævar Arnfjörð Bjarmason, Jul 1, 2022
  21. 03/11 submodule.c: free() memory from xgetcwd()Ævar Arnfjörð Bjarmason, Jul 1, 2022
  22. 04/11 revert: free "struct replay_opts" membersÆvar Arnfjörð Bjarmason, Jul 1, 2022
  23. 05/11 cat-file: fix a memory leak in --batch-command modeÆvar Arnfjörð Bjarmason, Jul 1, 2022
  24. 06/11 merge-file: refactor for subsequent memory leak fixÆvar Arnfjörð Bjarmason, Jul 1, 2022
  25. 09/11 gc: fix a memory leakÆvar Arnfjörð Bjarmason, Jul 1, 2022
  26. 08/11 checkout: avoid "struct unpack_trees_options" leakÆvar Arnfjörð Bjarmason, Jul 1, 2022
  27. Junio C HamanoJul 1, 2022
  28. 07/11 merge-file: fix memory leaks on error pathÆvar Arnfjörð Bjarmason, Jul 1, 2022
  29. 10/11 cat-file: fix a common "struct object_context" memory leakÆvar Arnfjörð Bjarmason, Jul 1, 2022
  30. 11/11 pull: fix a "struct oid_array" memory leakÆvar Arnfjörð Bjarmason, Jul 1, 2022
  31. Junio C HamanoJul 1, 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.