]> granicus.if.org Git - graphviz/commitdiff
circogen init_nodelistitem: 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: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/nodelist.c

index b943e6d1036b9ed4ee5d5c9888fa767ee15b6277..94c13612d9d1b75b54d71a79474d74bf91dab006 100644 (file)
@@ -8,14 +8,14 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
-
+#include       <cgraph/alloc.h>
 #include       <circogen/nodelist.h>
 #include       <circogen/circular.h>
 #include       <assert.h>
 
 static nodelistitem_t *init_nodelistitem(Agnode_t * n)
 {
-    nodelistitem_t *p = NEW(nodelistitem_t);
+    nodelistitem_t *p = gv_alloc(sizeof(nodelistitem_t));
     p->curr = n;
     return p;
 }