]> git.ipfire.org Git - thirdparty/git.git/commitdiff
packfile: use hashmap_entry in delta_base_cache_entry
authorEric Wong <e@80x24.org>
Sun, 6 Oct 2019 23:30:26 +0000 (23:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Oct 2019 01:20:09 +0000 (10:20 +0900)
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>
packfile.c

index fc43a6c52c75a32548c20bbc4a5aa7d0cc3ddd0d..37fe0b73a6b1e5ba75aba6c32962392d9d7e48e3 100644 (file)
@@ -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;