]> granicus.if.org Git - graphviz/commitdiff
neatogen newitem: 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, 3 Dec 2022 20:50:34 +0000 (12:50 -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/neatosplines.c

index 487ee49b8ff4e4e2e2495e40d2727ea19cb9b97f..5766163324878ee36f5f0d051f0efaf8065ad31e 100644 (file)
@@ -115,7 +115,7 @@ static void *newitem(Dt_t * d, edgeitem * obj, Dtdisc_t * disc)
 
     (void)d;
     (void)disc;
-    newp = NEW(edgeitem);
+    newp = gv_alloc(sizeof(edgeitem));
     newp->id = obj->id;
     newp->e = obj->e;
     ED_count(newp->e) = 1;