]> granicus.if.org Git - graphviz/commitdiff
sfdpgen maximal_independent_vertex_set: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Sep 2022 03:09:06 +0000 (20:09 -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 6fe3cc943fee7fd0a4fcf9e141b19a6a60f2069a..7d603078dc490ee01e2b4678da97555225570877 100644 (file)
@@ -80,7 +80,7 @@ static void maximal_independent_vertex_set(SparseMatrix A, int randomize, int **
   m = A->m;
   n = A->n;
   assert(n == m);
-  *vset = N_GNEW(m,int);
+  *vset = gv_calloc(m, sizeof(int));
   for (i = 0; i < m; i++) (*vset)[i] = MAX_IND_VTX_SET_U;
   *nvset = 0;
   *nzc = 0;