]> granicus.if.org Git - graphviz/commitdiff
circogen mkItem: use cgraph wrapper 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:43:35 +0000 (14:43 -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/deglist.c

index 7ca98b73c9bc900168042b9feb6aa9540638fa3c..3acaf7725bc325b098a41f884e15acd86d9e9e62 100644 (file)
@@ -8,7 +8,7 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-
+#include <cgraph/alloc.h>
 #include <circogen/deglist.h>
 #include <circogen/circular.h>
 #include <circogen/blockpath.h>
@@ -25,7 +25,7 @@ static degitem *mkItem(Dt_t * d, degitem * obj, Dtdisc_t * disc)
     (void)d;
     (void)disc;
 
-    degitem *ap = GNEW(degitem);
+    degitem *ap = gv_alloc(sizeof(degitem));
 
     ap->np = NULL;
     ap->deg = obj->deg;