Skip to content

Commit d0a48a0

Browse files
Eric Wonggitster
authored andcommitted
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 <[email protected]> Reviewed-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 12878c8 commit d0a48a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ struct delta_base_cache_key {
13611361
};
13621362

13631363
struct delta_base_cache_entry {
1364-
struct hashmap hash;
1364+
struct hashmap_entry ent;
13651365
struct delta_base_cache_key key;
13661366
struct list_head lru;
13671367
void *data;

0 commit comments

Comments
 (0)