From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: John Cai <johncai86@gmail.com>, git <git@vger.kernel.org>,
Christian Couder <christian.couder@gmail.com>
Subject: Re: [PATCH 1/3] fsck: free tree buffers after walking unreachable objects
Date: Thu, 22 Sep 2022 12:27:33 -0700 [thread overview]
Message-ID: <xmqq5yhfyztm.fsf@gitster.g> (raw)
In-Reply-To: <YyywSdrWO61Kza0e@coredump.intra.peff.net> (Jeff King's message of "Thu, 22 Sep 2022 14:58:17 -0400")
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.
next prev parent reply other threads:[~2022-09-22 19:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 19:27 [INVESTIGATION] why is fsck --connectivity-only so much more expensive than rev-list --objects --all? John Cai
2022-09-20 20:41 ` Jeff King
2022-09-22 10:09 ` [PATCH 0/3] reducing fsck memory usage Jeff King
2022-09-22 10:11 ` [PATCH 1/3] fsck: free tree buffers after walking unreachable objects Jeff King
2022-09-22 18:40 ` Junio C Hamano
2022-09-22 18:58 ` Jeff King
2022-09-22 19:27 ` Junio C Hamano [this message]
2022-09-22 22:16 ` Jeff King
2022-09-22 10:13 ` [PATCH 2/3] fsck: turn off save_commit_buffer Jeff King
2022-09-22 10:15 ` [PATCH 3/3] parse_object_buffer(): respect save_commit_buffer 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5yhfyztm.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=johncai86@gmail.com \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).