]> granicus.if.org Git - graphviz/commitdiff
sfdpgen maximal_independent_edge_set: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 03:10:04 +0000 (20:10 -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 31c523a5a2ad13f6146d3bd84f05b290b09a2fdc..09384badf1ced0386170911bdc628e0c79b2979a 100644 (file)
@@ -198,7 +198,7 @@ static void maximal_independent_edge_set(SparseMatrix A, int randomize, int **ma
   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;