]> granicus.if.org Git - graphviz/commitdiff
sfdpgen maximal_independent_edge_set_heavest…: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 03:13:55 +0000 (20:13 -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 9e7fefecd5387f86815d7bfccee085d733662caa..7de0060d0ba5f5f6d900d1f165ba02c080d9c89a 100644 (file)
@@ -741,7 +741,7 @@ static void maximal_independent_edge_set_heavest_edge_pernode_scaled(SparseMatri
   m = A->m;
   n = A->n;
   assert(n == m);
-  *matching = N_GNEW(m,int);
+  *matching = gv_calloc(m, sizeof(int));
   for (i = 0; i < m; i++) (*matching)[i] = i;
   *nmatch = n;