]> granicus.if.org Git - graphviz/commitdiff
circogen makeDerivedNode: use cgraph wrappers for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Nov 2022 20:02:53 +0000 (12:02 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 24 Nov 2022 22:47:43 +0000 (14:47 -0800)
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

index 6ecceaee99b7d92f30144554d283548befa2b934..d94e4083dcdb0c23e621d8f89c5714c30b07a9ad 100644 (file)
@@ -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);