]> granicus.if.org Git - graphviz/commitdiff
neatogen addTri: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Nov 2022 01:14:41 +0000 (17:14 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Nov 2022 05:29:08 +0000 (21:29 -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/neatogen/multispline.c

index a6a03970ab3ec634a2287508a551b743ffe2ff4a..7d6c92f654dd6d7fa27dd491f9bc89339c258251 100644 (file)
@@ -239,7 +239,7 @@ static void mapTri(Dt_t * map, tri * tp)
 static tri *
 addTri(int i, int j, tri * oldp)
 {
-    tri *tp = NEW(tri);
+    tri *tp = gv_alloc(sizeof(tri));
     tp->v.i = i;
     tp->v.j = j;
     tp->nxttri = oldp;