From 22f4c44fd8157bccb92cfb41f6599c65040867c8 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 14 Sep 2022 18:14:34 -0700 Subject: [PATCH] sparse SparseMatrix_distance_matrix_khops: use cgraph wrappers for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- lib/sparse/SparseMatrix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index 922e30d3a..c4b49208c 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -2452,8 +2451,8 @@ SparseMatrix SparseMatrix_distance_matrix_khops(int khops, SparseMatrix D0, int } } } else { - list = MALLOC(sizeof(int)*n); - dist = MALLOC(sizeof(double)*n); + list = gv_calloc(n, sizeof(int)); + dist = gv_calloc(n, sizeof(double)); /* Dijkstra_khops(khops, D, 60, dist, &nlist, list, &dmax); for (j = 0; j < nlist; j++){ -- 2.40.0