From 83cde1ac6ccf36f16f83ee67f887a11bfc5f9544 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 20 Nov 2022 12:02:53 -0800 Subject: [PATCH] circogen makeDerivedNode: 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/circogen/circularinit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/circogen/circularinit.c b/lib/circogen/circularinit.c index 6ecceaee9..d94e4083d 100644 --- a/lib/circogen/circularinit.c +++ b/lib/circogen/circularinit.c @@ -80,9 +80,9 @@ static node_t *makeDerivedNode(graph_t * dg, char *name, int isNode, { node_t *n = agnode(dg, name,1); agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), true); //node custom data - ND_alg(n) = NEW(cdata); + ND_alg(n) = gv_alloc(sizeof(cdata)); if (isNode) { - ND_pos(n) = N_NEW(Ndim, double); + ND_pos(n) = gv_calloc(Ndim, sizeof(double)); ND_lw(n) = ND_lw(orig); ND_rw(n) = ND_rw(orig); ND_ht(n) = ND_ht(orig); -- 2.50.1