From 4009fccab2ae5c56dc7bb2c6b51acd5c581fc7d8 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 9 Sep 2022 20:42:18 -0700 Subject: [PATCH] sfdpgen power_law_graph: use cgraph wrapper 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/sfdpgen/spring_electrical.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sfdpgen/spring_electrical.c b/lib/sfdpgen/spring_electrical.c index 9abeef17e..5c9f32ba5 100644 --- a/lib/sfdpgen/spring_electrical.c +++ b/lib/sfdpgen/spring_electrical.c @@ -1626,10 +1626,10 @@ static void prolongate(int dim, SparseMatrix A, SparseMatrix P, SparseMatrix R, int power_law_graph(SparseMatrix A){ - int *mask, m, max = 0, i, *ia = A->ia, *ja = A->ja, j, deg; + int m, max = 0, i, *ia = A->ia, *ja = A->ja, j, deg; int res = FALSE; m = A->m; - mask = MALLOC(sizeof(int)*(m+1)); + int *mask = gv_calloc(m + 1, sizeof(int)); for (i = 0; i < m + 1; i++){ mask[i] = 0; -- 2.50.1