From 67b9f70c8e6ef06cf8e24b38a5ec92e2d2791efd Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 14 Sep 2022 17:58:56 -0700 Subject: [PATCH] =?utf8?q?sparse=20SparseMatrix=5Fweakly=5Fconnected=5Fcom?= =?utf8?q?pone=E2=80=A6:=20use=20cgraph=20wrapper=20for=20allocation?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index df5ae3be8..cd984f1c7 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -1840,7 +1840,7 @@ void SparseMatrix_weakly_connected_components(SparseMatrix A0, int *ncomp, int * if (!SparseMatrix_is_symmetric(A, true)){ A = SparseMatrix_symmetrize(A, true); } - if (!(*comps_ptr)) *comps_ptr = MALLOC(sizeof(int)*((size_t)(m+1))); + if (!(*comps_ptr)) *comps_ptr = gv_calloc((size_t)(m + 1), sizeof(int)); *ncomp = 0; (*comps_ptr)[0] = 0; -- 2.50.1