summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:26 +0000
committerJunio C Hamano <gitster@pobox.com>2019-10-07 10:20:09 +0900
commitd0a48a0a1d0df49af2e5fd6a80b0d84776c285aa (patch)
tree6a84509ba1afa9e2ca1bfe2577e6e634774346e1 /packfile.c
parent12878c83516e3b82f31a20f1b5431b7ff607a8db (diff)
downloadgit-d0a48a0a1d0df49af2e5fd6a80b0d84776c285aa.tar.gz
packfile: use hashmap_entry in delta_base_cache_entry
This hashmap_entry_init function is intended to take a hashmap_entry struct pointer, not a hashmap struct pointer. This was not noticed because hashmap_entry_init takes a "void *" arg instead of "struct hashmap_entry *", and the hashmap struct is larger and can be cast into a hashmap_entry struct without data corruption. This has the beneficial side effect of reducing the size of a delta_base_cache_entry from 104 bytes to 72 bytes on 64-bit systems. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/packfile.c b/packfile.c
index fc43a6c52c..37fe0b73a6 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1361,7 +1361,7 @@ struct delta_base_cache_key {
};
struct delta_base_cache_entry {
- struct hashmap hash;
+ struct hashmap_entry ent;
struct delta_base_cache_key key;
struct list_head lru;
void *data;