summaryrefslogtreecommitdiff
path: root/builtin/difftool.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-02 22:30:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-02 22:30:43 (GMT)
commitae533c4a92aef6ab180441dbb76ef83521fc87d6 (patch)
tree0e722c62f6fb4a7d053bdb9bcb37115d8946336b /builtin/difftool.c
parent30bf8d9f4f06d8e35793612c8611cb03c53a73db (diff)
parent8616a2d0cb57865540f1c00ac2e5385a6cc5d84e (diff)
downloadgit-ae533c4a92aef6ab180441dbb76ef83521fc87d6.zip
git-ae533c4a92aef6ab180441dbb76ef83521fc87d6.tar.gz
git-ae533c4a92aef6ab180441dbb76ef83521fc87d6.tar.bz2
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 'builtin/difftool.c')
-rw-r--r--builtin/difftool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 51f6c9c..3018e61 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -322,10 +322,10 @@ static int checkout_path(unsigned mode, struct object_id *oid,
struct cache_entry *ce;
int ret;
- ce = make_cache_entry(mode, oid->hash, path, 0, 0);
+ ce = make_transient_cache_entry(mode, oid, path, 0);
ret = checkout_entry(ce, state, NULL);
- free(ce);
+ discard_cache_entry(ce);
return ret;
}
@@ -489,7 +489,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
* index.
*/
struct cache_entry *ce2 =
- make_cache_entry(rmode, roid.hash,
+ make_cache_entry(&wtindex, rmode, &roid,
dst_path, 0, 0);
add_index_entry(&wtindex, ce2,