aboutsummaryrefslogtreecommitdiff
path: root/hashmap.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-12-23 11:33:16 +0900
committerJunio C Hamano <gitster@pobox.com>2025-12-23 11:33:16 +0900
commit396df67739bed1615e92071961e3e4d2bf378c16 (patch)
treeaebed06b96b6cb69243d1eccab1c0450068f89c7 /hashmap.c
parentc77ba76807f30c2d69febbe8ad1f6b03ba4314f1 (diff)
parent467860bc0b0447093ae97bcecf1655131732338f (diff)
downloadgit-396df67739bed1615e92071961e3e4d2bf378c16.tar.xz
Merge branch 'tc/memzero-array'
MEMZERO_ARRAY() helper is introduced to avoid clearing only the first N bytes of an N-element array whose elements are larger than a byte. * tc/memzero-array: contrib/coccinelle: pass include paths to spatch(1) git-compat-util: introduce MEMZERO_ARRAY() macro
Diffstat (limited to 'hashmap.c')
-rw-r--r--hashmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hashmap.c b/hashmap.c
index a711377853..3b5d6f14bc 100644
--- a/hashmap.c
+++ b/hashmap.c
@@ -194,7 +194,7 @@ void hashmap_partial_clear_(struct hashmap *map, ssize_t entry_offset)
return;
if (entry_offset >= 0) /* called by hashmap_clear_entries */
free_individual_entries(map, entry_offset);
- memset(map->table, 0, map->tablesize * sizeof(struct hashmap_entry *));
+ MEMZERO_ARRAY(map->table, map->tablesize);
map->shrink_at = 0;
map->private_size = 0;
}