]> git.ipfire.org Git - thirdparty/git.git/commit
pack-objects: widen `free_unpacked()` return to `size_t`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 9 Jul 2026 16:49:31 +0000 (16:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Jul 2026 21:55:23 +0000 (14:55 -0700)
commit445aa3cd593d579c03ff45cd336e19e3e2638f0a
tree61fb0ec24a8f8d4d62ffbe0de177228df3c79e01
parenteb1d699586f4288780c6748e21e12b45369376ef
pack-objects: widen `free_unpacked()` return to `size_t`

`free_unpacked()` sums two byte counts: `sizeof_delta_index()` and
`SIZE(n->entry)`. The latter has been `size_t` since the prior topic
"More work supporting objects larger than 4GB on Windows" widened
`SIZE()`/`oe_size()` to `size_t`, so accumulating it into an `unsigned
long` return was a silent Windows-only truncation on a packing run with
many large objects.

The sole caller, `find_deltas()`, still holds its own `mem_usage` in an
`unsigned long` for now, and therefore still truncates silently.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c