Skip to content

Commit 5e6f359

Browse files
derrickstoleegitster
authored andcommitted
read-cache: free threaded memory pool
In load_cache_entries_threaded(), each thread allocates its own memory pool. This pool needs to be cleaned up while closing the threads down, or it will be leaked. This ce_mem_pool pointer could theoretically be converted to an inline copy of the struct, but the use of a pointer helps with existing lazy- initialization logic. Adjusting that behavior only to avoid this pointer would be a much bigger change. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 39bf06a commit 5e6f359

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

read-cache.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,6 +2187,7 @@ static unsigned long load_cache_entries_threaded(struct index_state *istate, con
21872187
if (err)
21882188
die(_("unable to join load_cache_entries thread: %s"), strerror(err));
21892189
mem_pool_combine(istate->ce_mem_pool, p->ce_mem_pool);
2190+
free(p->ce_mem_pool);
21902191
consumed += p->consumed;
21912192
}
21922193

0 commit comments

Comments
 (0)