From: Eric Wong Date: Sun, 6 Oct 2019 23:30:26 +0000 (+0000) Subject: packfile: use hashmap_entry in delta_base_cache_entry X-Git-Tag: v2.24.0-rc0~21^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d0a48a0a1d0df49af2e5fd6a80b0d84776c285aa;p=thirdparty%2Fgit.git 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 Reviewed-by: Derrick Stolee Signed-off-by: Junio C Hamano --- 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;