Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-09-04 20:33:55 +0300
committerJunio C Hamano <gitster@pobox.com>2020-09-06 22:34:12 +0300
commitbcd2c5eedecf473fa6b15ebda798ce54bb3c75ea (patch)
tree55b9081509ef916894a7f037a22073120116546b /read-cache.c
parentf87bf28483ae6db32b3ac246ff7081d64a608327 (diff)
read-cache: fix mem-pool allocation for multi-threaded index loading
44c7e1a7e0 (mem-pool: use more standard initialization and finalization, 2020-08-15) moved the allocation of the mem-pool structure to callers. It also added an allocation to load_cache_entries_threaded(), but for an unrelated mem-pool. Fix that by allocating the correct one instead -- the one that is initialized two lines later. Reported-by: Sandor Bodo-Merle <sbodomerle@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index fa291cdbee..ecf6f68994 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2101,7 +2101,7 @@ static unsigned long load_cache_entries_threaded(struct index_state *istate, con
nr = 0;
for (j = p->ieot_start; j < p->ieot_start + p->ieot_blocks; j++)
nr += p->ieot->entries[j].nr;
- istate->ce_mem_pool = xmalloc(sizeof(*istate->ce_mem_pool));
+ p->ce_mem_pool = xmalloc(sizeof(*istate->ce_mem_pool));
if (istate->version == 4) {
mem_pool_init(p->ce_mem_pool,
estimate_cache_size_from_compressed(nr));