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

Re: [PATCH v2] pack-objects: use size_t for streamed large blobs

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 1, 2026, 06:37 UTC
Message-ID
<xmqqse1l12hh.fsf@gitster.g>
In-Reply-To
<20261031183748.273957-1-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 8 quoted lines
> In builtin/pack-objects.c, write_no_reuse_object() handles blobs
> exceeding core.bigFileThreshold by writing them in a streaming path. It
> takes the size from st->size (size_t) and assigns it to an "unsigned
> long" variable, which is then written to the pack object header, and
> write_large_blob_data() adds up the compressed length in an "unsigned
> long" as well.
>
> On platforms where "long" is 32 bits, handling a blob of 4GiB or more

On 32-bit boxes, replacing ulong with size_t would not fix anything, which you already had an discussion.

Please rewrite the above to stress that you are talking about platforms where "long" is 32 bits but "size_t" is larger than that, so that the next person do not have to be puzzled by thinking this is about 32-bit boxes.

Previous: Elia PintoNext: Elia Pinto
Message 3 of 5 in “pack-objects: use size_t for streamed large blobs”
  1. pack-objects: use size_t for streamed large blobsElia Pinto, Oct 31, 2026
  2. pack-objects: use size_t for streamed large blobsElia Pinto, Oct 31, 2026
  3. Junio C HamanoNov 1, 2026
  4. pack-objects: use size_t for streamed large blobsElia Pinto, Nov 1, 2026
  5. Junio C HamanoNov 3, 2026

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.