From: Matthew Fernandez Date: Sat, 10 Sep 2022 03:08:32 +0000 (-0700) Subject: sfdpgen Multilevel_init: use cgraph wrapper for allocation X-Git-Tag: 6.0.2~44^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=627058aa6e2bd88bdc03567d2e5fe747a3addc53;p=graphviz sfdpgen Multilevel_init: use cgraph wrapper 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 c03310f02..6fe3cc943 100644 --- a/lib/sfdpgen/Multilevel.c +++ b/lib/sfdpgen/Multilevel.c @@ -34,10 +34,9 @@ void Multilevel_control_delete(Multilevel_control ctrl){ } static Multilevel Multilevel_init(SparseMatrix A, SparseMatrix D, double *node_weights){ - Multilevel grid; if (!A) return NULL; assert(A->m == A->n); - grid = GNEW(struct Multilevel_struct); + Multilevel grid = gv_alloc(sizeof(struct Multilevel_struct)); grid->level = 0; grid->n = A->n; grid->A = A;