Thread (24 messages) 24 messages, 3 authors, 2019-10-08
STALE2451d REVIEWED: 1 (0M)
Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH v3 03/20] packfile: use hashmap_entry in delta_base_cache_entry

From: Eric Wong <hidden>
Date: 2019-10-06 23:30:56
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
Reviewed-by: Derrick Stolee <redacted>
---
 packfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help