index-pack: remove redundant child field
authorJonathan Tan <jonathantanmy@google.com>
Mon, 24 Aug 2020 19:16:35 +0000 (12:16 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Aug 2020 21:11:14 +0000 (14:11 -0700)
commita7f7e84a496d194ceeeba9827d17c4c206932d2b
tree58e17e4e3686b3ece1b22427302c93722d863d2c
parent46e6fb1e4462fa4363b3d6ace827140dd1c4bc39
index-pack: remove redundant child field

This is refactoring 1 of 2 to simplify struct base_data.

In index-pack, each thread maintains a doubly-linked list of the delta
chain that it is currently processing (the "base" and "child" pointers
in struct base_data). When a thread exceeds the delta base cache limit
and needs to reclaim memory, it uses the "child" pointers to traverse
the lineage, reclaiming the memory of the eldest delta bases first.

A subsequent patch will perform memory reclaiming in a different way and
will thus no longer need the "child" pointer. Because the "child"
pointer is redundant even now, remove it so that the aforementioned
subsequent patch will be clearer. In the meantime, reclaim memory in the
reverse order of the "base" pointers.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/index-pack.c