summaryrefslogtreecommitdiffstats
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-02 15:30:43 -0700
committerJunio C Hamano <gitster@pobox.com>2018-08-02 15:30:43 -0700
commitae533c4a92aef6ab180441dbb76ef83521fc87d6 (patch)
tree0e722c62f6fb4a7d053bdb9bcb37115d8946336b /merge-recursive.c
parent30bf8d9f4f06d8e35793612c8611cb03c53a73db (diff)
parent8616a2d0cb57865540f1c00ac2e5385a6cc5d84e (diff)
downloadgit-ae533c4a92aef6ab180441dbb76ef83521fc87d6.tar.gz
git-ae533c4a92aef6ab180441dbb76ef83521fc87d6.tar.xz
Merge branch 'jm/cache-entry-from-mem-pool'
For a large tree, the index needs to hold many cache entries allocated on heap. These cache entries are now allocated out of a dedicated memory pool to amortize malloc(3) overhead. * jm/cache-entry-from-mem-pool: block alloc: add validations around cache_entry lifecyle block alloc: allocate cache entries from mem_pool mem-pool: fill out functionality mem-pool: add life cycle management functions mem-pool: only search head block for available space block alloc: add lifecycle APIs for cache_entry structs read-cache: teach make_cache_entry to take object_id read-cache: teach refresh_cache_entry to take istate
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 3d6b34b4f..07d792fd1 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -320,7 +320,7 @@ static int add_cacheinfo(struct merge_options *o,
struct cache_entry *ce;
int ret;
- ce = make_cache_entry(mode, oid ? oid->hash : null_sha1, path, stage, 0);
+ ce = make_cache_entry(&the_index, mode, oid ? oid : &null_oid, path, stage, 0);
if (!ce)
return err(o, _("add_cacheinfo failed for path '%s'; merge aborting."), path);
@@ -328,7 +328,7 @@ static int add_cacheinfo(struct merge_options *o,
if (refresh) {
struct cache_entry *nce;
- nce = refresh_cache_entry(ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING);
+ nce = refresh_cache_entry(&the_index, ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING);
if (!nce)
return err(o, _("add_cacheinfo failed to refresh for path '%s'; merge aborting."), path);
if (nce != ce)