aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-21 15:15:20 -0700
committerJunio C Hamano <gitster@pobox.com>2016-09-21 15:15:20 -0700
commit13307145a97c7028403801fc4ead26bff794cead (patch)
tree9e677b35b04c3828d1965afe9acff114a3ef3997
parenta9817aaef8b1bd7aadc6de599720d3706cc352f6 (diff)
parent4b92bae7d363adfe923337f198f9c98dc1c68e27 (diff)
downloadgit-13307145a97c7028403801fc4ead26bff794cead.tar.gz
git-13307145a97c7028403801fc4ead26bff794cead.tar.xz
Merge branch 'jk/delta-base-cache'
Recently we updated the code to manage the in-core cache that holds objects that have recently been used to reconstitute other objects that are stored as deltas against them, but the update used an incorrect API function to manage the list of these objects. This has been fixed. * jk/delta-base-cache: add_delta_base_cache: use list_for_each_safe
-rw-r--r--sha1_file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 472ccb2ff..46b25edcb 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2269,11 +2269,11 @@ static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
void *base, unsigned long base_size, enum object_type type)
{
struct delta_base_cache_entry *ent = xmalloc(sizeof(*ent));
- struct list_head *lru;
+ struct list_head *lru, *tmp;
delta_base_cached += base_size;
- list_for_each(lru, &delta_base_cache_lru) {
+ list_for_each_safe(lru, tmp, &delta_base_cache_lru) {
struct delta_base_cache_entry *f =
list_entry(lru, struct delta_base_cache_entry, lru);
if (delta_base_cached <= delta_base_cache_limit)