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.