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

Re: [PATCH 2/2] pack-bitmap.c: ensure pseudo-merge offset reads are bounded

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2024, 18:23 UTC
Message-ID
<xmqqa5jnfko6.fsf@gitster.g>
In-Reply-To
<ZmI6SqIFkWz8OPr1@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 24 quoted lines
> On Thu, Jun 06, 2024 at 03:35:51PM -0700, Junio C Hamano wrote:
>> Taylor Blau <me@ttaylorr.com> writes:
>>
>> > On Thu, Jun 06, 2024 at 12:42:59PM -0700, Junio C Hamano wrote:
>> >> Can table_size at this point be smaller than 24, which will allow
>> >> (table_size - 24) to be a huge number that st_mult() will
>> >> comfortably fit?
>> >
>> > It could be smaller than 24, but I think we're at the point of
>> > diminishing returns here.
>>
>> I only meant to say that we could easily rewrite
>>
>> 	if (st_mult() > table_size - 24)
>>
>> condition to
>>
>> 	if (st_add(st_mult(), 24) > table_size)
>>
>> and we do not have to think if we have already checked table_size
>> before we reach this point of the control flow.
>
> Ah. Thanks for the clarification. Yes, I think you could do so; I'm
> happy to send another version if you like.

Let's get this thing unstuck; the other larger topic that this topic builds upon is stuck for too long.

Previous: Taylor BlauNext: Taylor Blau
Message 7 of 12 in “Documentation/technical/bitmap-format.txt: add missing position table”
  1. 1/2 Documentation/technical/bitmap-format.txt: add missing position tableTaylor Blau, Jun 6, 2024
  2. 2/2 pack-bitmap.c: ensure pseudo-merge offset reads are boundedTaylor Blau, Jun 6, 2024
  3. Junio C HamanoJun 6, 2024
  4. Taylor BlauJun 6, 2024
  5. Junio C HamanoJun 6, 2024
  6. Taylor BlauJun 6, 2024
  7. Junio C HamanoJun 14, 2024
  8. 0/2 pseudo-merge: various small fixesTaylor Blau, Jun 14, 2024
  9. 1/2 Documentation/technical/bitmap-format.txt: add missing position tableTaylor Blau, Jun 14, 2024
  10. 2/2 pack-bitmap.c: ensure pseudo-merge offset reads are boundedTaylor Blau, Jun 14, 2024
  11. Elijah NewrenJun 14, 2024
  12. Junio C HamanoJun 14, 2024

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.