From: Junio C Hamano <gitster@pobox.com>
To: Elijah Conners <business@elijahpepe.com>
Cc: "git" <git@vger.kernel.org>, "hanwen" <hanwen@google.com>
Subject: Re: [PATCH] reftable: pass pq_entry by address
Date: Wed, 14 Sep 2022 19:27:11 -0700 [thread overview]
Message-ID: <xmqqsfktpe2o.fsf@gitster.g> (raw)
In-Reply-To: 18337ea407a.10c144c52599576.4708941661785569426@elijahpepe.com
Elijah Conners <business@elijahpepe.com> writes:
> Junio C Hamano <gitster@pobox.com> writes:
> > Do we have any hard guidance like "do not pass an data item whose
> > size is larger than 64 bytes" in our coding guidelines? If not,
> > make sure that the reference to 64 bytes does not look like one.
> While we don't have hard guidance like that, putting an object that exceeds 64 bytes on the stack is dangerous.
>
> > In any case, wouldn't it make sense to make the "we pass reference
> > not because we want to let the callee modify the value, but because
> > the callee deep in the callchain wants to copy the contents out of
> > it" parameter a pointer to a constant?
> Yes. I overlooked that making this change. Feel free to make that change, otherwise I'll do it myself.
OK, will wait for an updated patch that corrects the proposed log
message (i.e. not to say "size is larger than 64 bytes hence this is
bad") with a const pointer.
Note that this project tries to avoid piling "oops the previous one
was wrong, and this is a fix" patches on top of earlier patch that
are faulty or suboptimal. Instead "v2" and later patches are
written as if an earlier iteration never happened, i.e. allowing the
author to pretend to be perfect human ;-).
Thanks.
next prev parent reply other threads:[~2022-09-15 2:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 4:53 [PATCH] reftable: pass pq_entry by address Elijah Conners
2022-09-13 9:11 ` Han-Wen Nienhuys
2022-09-13 15:55 ` Junio C Hamano
2022-09-13 17:34 ` Elijah Conners
2022-09-13 17:36 ` Han-Wen Nienhuys
2022-09-13 18:03 ` Elijah Conners
2022-09-15 7:49 ` Han-Wen Nienhuys
2022-09-15 2:27 ` Junio C Hamano [this message]
2022-09-14 23:54 ` [PATCH] reftable: use const with the pq_entry param Elijah Conners
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=xmqqsfktpe2o.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=business@elijahpepe.com \
--cc=git@vger.kernel.org \
--cc=hanwen@google.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).