From: Matthew Fernandez Date: Sat, 10 Sep 2022 03:11:32 +0000 (-0700) Subject: sfdpgen maximal_independent_edge_set_heaves…: use cgraph wrappers for allocation X-Git-Tag: 6.0.2~44^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43a1b8ae610ae7d5f1fb928bad29c553917f113e;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 d5f127635..6f9f81882 100644 --- a/lib/sfdpgen/Multilevel.c +++ b/lib/sfdpgen/Multilevel.c @@ -328,9 +328,9 @@ static void maximal_independent_edge_set_heavest_edge_pernode_leaves_first(Spars 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); + *cluster = gv_calloc(m, sizeof(int)); + *clusterp = gv_calloc(m + 1, sizeof(int)); + matched = gv_calloc(m, sizeof(int)); for (i = 0; i < m; i++) matched[i] = i;