From: Matthew Fernandez Date: Sat, 10 Sep 2022 03:13:09 +0000 (-0700) Subject: sfdpgen maximal_independent_edge_set_heaves…: use cgraph wrappers for allocation X-Git-Tag: 6.0.2~44^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93c6f8878bf8f7030324545d8017fb1cccc792a5;p=graphviz sfdpgen maximal_independent_edge_set_heaves…: 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. --- diff --git a/lib/sfdpgen/Multilevel.c b/lib/sfdpgen/Multilevel.c index 9c35b21da..9e7fefecd 100644 --- a/lib/sfdpgen/Multilevel.c +++ b/lib/sfdpgen/Multilevel.c @@ -648,10 +648,10 @@ static void maximal_independent_edge_set_heavest_cluster_pernode_leaves_first(Sp m = A->m; n = A->n; assert(n == m); - *cluster = N_GNEW(m,int); - *clusterp = N_GNEW((m+1),int); - matched = N_GNEW(m,int); - vlist = N_GNEW(2*m,double); + *cluster = gv_calloc(m, sizeof(int)); + *clusterp = gv_calloc(m + 1, sizeof(int)); + matched = gv_calloc(m, sizeof(int)); + vlist = gv_calloc(2 * m, sizeof(double)); for (i = 0; i < m; i++) matched[i] = i;