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

Re: [PATCH 1/3] fsck: free tree buffers after walking unreachable objects

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2022, 19:27 UTC
Message-ID
<xmqq5yhfyztm.fsf@gitster.g>
In-Reply-To
<YyywSdrWO61Kza0e@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I do think it is true that this is the final time we'd look at these
> objects. But I don't think it would be a disaster if somebody did. The
> free_tree_buffer() function clears the "parsed" flag on the struct. 
Ah, that is perfectly fine, then.  Thanks.
> As a side note, IMHO having tree->buffer at all is a mistake, because it
> leads to exactly this kind of confusion about when the buffer should be
> discarded. We'd be better off having all callers parse directly into a
> local buffer, and then clean up when they're done.

Yeah, tree-walk.c users woud use tree_desc structure anyway, and instead of having a moving pointer that points into a separate thing (i.e. tree->buffer), it could have its own copy of the "whole buffer" that can be used to free when it is done iterating over entries.

> .... But that's obviously a much bigger change.
Yup.
Thanks.
Previous: Jeff KingNext: Jeff King
Message 7 of 10 in “[INVESTIGATION] why is fsck --connectivity-only so much more expensive than rev-list --objects --all?”
  1. John CaiSep 20, 2022
  2. Jeff KingSep 20, 2022
  3. 0/3 reducing fsck memory usageJeff King, Sep 22, 2022
  4. 1/3 fsck: free tree buffers after walking unreachable objectsJeff King, Sep 22, 2022
  5. Junio C HamanoSep 22, 2022
  6. Jeff KingSep 22, 2022
  7. Junio C HamanoSep 22, 2022
  8. Jeff KingSep 22, 2022
  9. 2/3 fsck: turn off save_commit_bufferJeff King, Sep 22, 2022
  10. 3/3 parse_object_buffer(): respect save_commit_bufferJeff King, Sep 22, 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.