Files
git/builtin
Han Xin a1bf5ca29f unpack-objects: low memory footprint for get_data() in dry_run mode
As the name implies, "get_data(size)" will allocate and return a given
amount of memory. Allocating memory for a large blob object may cause the
system to run out of memory. Before preparing to replace calling of
"get_data()" to unpack large blob objects in latter commits, refactor
"get_data()" to reduce memory footprint for dry_run mode.

Because in dry_run mode, "get_data()" is only used to check the
integrity of data, and the returned buffer is not used at all, we can
allocate a smaller buffer and use it as zstream output. Make the function
return NULL in the dry-run mode, as no callers use the returned buffer.

The "find [...]objects/?? -type f | wc -l" test idiom being used here
is adapted from the same "find" use added to another test in
d9545c7f46 (fast-import: implement unpack limit, 2016-04-25).

Suggested-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Han Xin <chiyutianyi@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-06-13 10:22:35 -07:00
..
2022-06-03 14:30:34 -07:00
2022-02-25 15:47:36 -08:00
2022-04-06 09:42:14 -07:00
2022-02-17 16:25:05 -08:00
2022-05-23 14:39:54 -07:00
2021-10-28 09:57:09 -07:00
2022-04-04 10:56:23 -07:00
2022-06-03 14:30:37 -07:00
2022-03-09 13:38:24 -08:00
2022-04-06 15:21:59 -07:00
2021-09-28 10:31:02 -07:00
2022-06-03 14:30:37 -07:00
2022-01-03 16:24:15 -08:00
2022-03-28 15:45:46 -07:00
2022-06-03 14:30:37 -07:00
2022-03-21 15:14:24 -07:00
2022-01-10 11:52:56 -08:00
2022-06-03 14:30:34 -07:00
2021-11-03 13:25:36 -07:00