From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Paulo Casaretto via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Paulo Casaretto <pcasaretto@gmail.com>
Subject: Re: [PATCH v3] range-diff: add configurable memory limit for cost matrix
Date: Fri, 29 Aug 2025 09:33:55 -0700 [thread overview]
Message-ID: <xmqq5xe6nl3g.fsf@gitster.g> (raw)
In-Reply-To: <CABPp-BHnCHiTFNKCrnpKF5STkeGNQWMxdVMZ_v-Rp2judZVEgw@mail.gmail.com> (Elijah Newren's message of "Fri, 29 Aug 2025 08:21:24 -0700")
Elijah Newren <newren@gmail.com> writes:
> On Fri, Aug 29, 2025 at 4:00 AM Paulo Casaretto via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>> -
>> - ALLOC_ARRAY(cost, st_mult(n, n));
>> + size_t cost_size = st_mult(n, n);
>> + size_t cost_bytes = st_mult(sizeof(int), cost_size);
>> + if (cost_bytes >= max_memory) {
>> + struct strbuf cost_str = STRBUF_INIT;
>> + struct strbuf max_str = STRBUF_INIT;
>> + strbuf_humanise_bytes(&cost_str, cost_bytes);
>> + strbuf_humanise_bytes(&max_str, max_memory);
>> + die(_("range-diff: unable to compute the range-diff, since it "
>> + "exceeds the maximum memory for the cost matrix: %s "
>> + "(%"PRIuMAX" bytes) needed, %s (%"PRIuMAX" bytes) available"),
>> + cost_str.buf, (uintmax_t)cost_bytes, max_str.buf, (uintmax_t)max_memory);
>> + }
>> + ALLOC_ARRAY(cost, cost_size);
>> ALLOC_ARRAY(a2b, n);
>> ALLOC_ARRAY(b2a, n);
>>
>
> This still has the same wording issue that I commented on in v2:
> https://lore.kernel.org/git/CABPp-BEDje5dYZHEyYMN6j_LdR5CqRN1cxc0riRK06qK-OxiTA@mail.gmail.com/
Right. I overlooked it, sorry.
next prev parent reply other threads:[~2025-08-29 16:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 17:18 [PATCH] range-diff: add configurable memory limit for cost matrix Paulo Casaretto via GitGitGadget
2025-08-26 19:18 ` Junio C Hamano
2025-08-28 8:38 ` [PATCH v2 0/2] " Paulo Casaretto via GitGitGadget
2025-08-28 8:38 ` [PATCH v2 1/2] range-diff: reorder options lexicographically pcasaretto via GitGitGadget
2025-08-28 15:21 ` Junio C Hamano
2025-08-28 17:12 ` Elijah Newren
2025-08-29 10:56 ` Paulo L F Casaretto
2025-08-29 15:15 ` Junio C Hamano
2025-08-28 8:38 ` [PATCH v2 2/2] range-diff: add configurable memory limit for cost matrix pcasaretto via GitGitGadget
2025-08-28 17:04 ` Elijah Newren
2025-08-28 21:22 ` Junio C Hamano
2025-08-28 21:34 ` Elijah Newren
2025-08-28 21:45 ` Junio C Hamano
2025-08-29 11:00 ` [PATCH v3] " Paulo Casaretto via GitGitGadget
2025-08-29 15:21 ` Elijah Newren
2025-08-29 16:33 ` Junio C Hamano [this message]
2025-08-29 15:40 ` Junio C Hamano
2025-08-29 16:02 ` [PATCH v4] " Paulo Casaretto via GitGitGadget
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=xmqq5xe6nl3g.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=pcasaretto@gmail.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).