]> granicus.if.org Git - graphviz/commitdiff
sfdpgen maximal_independent_edge_set_heaves…: use cgraph wrappers for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 03:11:32 +0000 (20:11 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 11 Sep 2022 23:56:02 +0000 (16:56 -0700)
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/Multilevel.c

index d5f127635c5d342c90d9b1162173b2037243ed5e..6f9f81882bcc64e563db4c0ded343c3e92a7583b 100644 (file)
@@ -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;