From ef6c88cb61bff91d9a0e20fa2f0cbb436ec51448 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 17 Nov 2022 17:14:41 -0800 Subject: [PATCH] fdpgen mkClusters: use cgraph wrappers 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. --- lib/fdpgen/layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index 8250ab9c0..bf91695bd 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -984,7 +984,7 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent) { if (!strncmp(agnameof(subg), "cluster", 7)) { agbindrec(subg, "Agraphinfo_t", sizeof(Agraphinfo_t), true); - GD_alg(subg) = NEW(gdata); /* freed in cleanup_subgs */ + GD_alg(subg) = gv_alloc(sizeof(gdata)); // freed in cleanup_subgs GD_ndim(subg) = GD_ndim(agroot(parent)); LEVEL(subg) = LEVEL(parent) + 1; GPARENT(subg) = parent; @@ -1010,7 +1010,7 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent) static void fdp_init_graph(Agraph_t * g) { setEdgeType (g, EDGETYPE_LINE); - GD_alg(g) = NEW(gdata); /* freed in cleanup_graph */ + GD_alg(g) = gv_alloc(sizeof(gdata)); // freed in cleanup_graph GD_ndim(agroot(g)) = late_int(g, agattr(g,AGRAPH, "dim", NULL), 2, 2); Ndim = GD_ndim(agroot(g)) = MIN(GD_ndim(agroot(g)), MAXDIM); -- 2.50.1