From 1a2da02db6b65a989bcccc0ec69c1d1540dec699 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 24 Feb 2025 23:26:23 +0100 Subject: [PATCH] HNSW: calloc() -> hmalloc(). --- hnsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hnsw.c b/hnsw.c index 75130722f..4b4fafa56 100644 --- a/hnsw.c +++ b/hnsw.c @@ -1200,7 +1200,8 @@ void hnsw_reconnect_nodes(HNSW *index, hnswNode **nodes, int count, uint32_t lay } // Step 5: Pair nodes greedily based on scores. - int *used = calloc(count, sizeof(int)); + int *used = hmalloc(count*sizeof(int)); + memset(used,0,count*sizeof(int)); if (!used) { hfree(distances); hfree(row_avgs);