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

Re: [PATCH v3] range-diff: add configurable memory limit for cost matrix

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 29, 2025, 16:33 UTC
Message-ID
<xmqq5xe6nl3g.fsf@gitster.g>
In-Reply-To
<CABPp-BHnCHiTFNKCrnpKF5STkeGNQWMxdVMZ_v-Rp2judZVEgw@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 23 quoted lines
> 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.
Previous: Elijah NewrenNext: Junio C Hamano
Message 16 of 18 in “range-diff: add configurable memory limit for cost matrix”
  1. range-diff: add configurable memory limit for cost matrixPaulo Casaretto via GitGitGadget, Aug 26, 2025
  2. Junio C HamanoAug 26, 2025
  3. 0/2 range-diff: add configurable memory limit for cost matrixPaulo Casaretto via GitGitGadget, Aug 28, 2025
  4. 1/2 range-diff: reorder options lexicographicallypcasaretto via GitGitGadget, Aug 28, 2025
  5. Junio C HamanoAug 28, 2025
  6. Elijah NewrenAug 28, 2025
  7. Paulo L F CasarettoAug 29, 2025
  8. Junio C HamanoAug 29, 2025
  9. 2/2 range-diff: add configurable memory limit for cost matrixpcasaretto via GitGitGadget, Aug 28, 2025
  10. Elijah NewrenAug 28, 2025
  11. Junio C HamanoAug 28, 2025
  12. Elijah NewrenAug 28, 2025
  13. Junio C HamanoAug 28, 2025
  14. range-diff: add configurable memory limit for cost matrixPaulo Casaretto via GitGitGadget, Aug 29, 2025
  15. Elijah NewrenAug 29, 2025
  16. Junio C HamanoAug 29, 2025
  17. Junio C HamanoAug 29, 2025
  18. range-diff: add configurable memory limit for cost matrixPaulo Casaretto via GitGitGadget, Aug 29, 2025

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.