]> granicus.if.org Git - graphviz/commitdiff
core plugin write_edges: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 4 Sep 2022 19:34:11 +0000 (12:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 5 Sep 2022 22:27:17 +0000 (15:27 -0700)
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.

plugin/core/gvrender_core_json.c

index 921db8fbcfb000916afb227767d7d867de9578e7..560337fcc19ff0aa7a1a91b62afe6be2bfac4e45 100644 (file)
@@ -27,6 +27,7 @@
 #include <gvc/gvplugin_render.h>
 #include <gvc/gvplugin_device.h>
 #include <cgraph/agxbuf.h>
+#include <cgraph/alloc.h>
 #include <cgraph/unreachable.h>
 #include <common/utils.h>
 #include <gvc/gvc.h>
@@ -476,7 +477,7 @@ static int write_edges(Agraph_t * g, GVJ_t * job, int top, state_t* sp)
         return 0;
     }
 
-    Agedge_t **edges = gcalloc(count, sizeof(Agedge_t *));
+    Agedge_t **edges = gv_calloc(count, sizeof(Agedge_t *));
 
     size_t i = 0;
     for (Agnode_t *np = agfstnode(g); np; np = agnxtnode(g, np)) {