From: Matthew Fernandez Date: Sun, 20 Nov 2022 20:02:53 +0000 (-0800) Subject: circogen mkBlock: use cgraph wrapper for allocation X-Git-Tag: 7.0.3~2^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=653a0d35ee61bf7208ab19c2735c1ed5723fde33;p=graphviz circogen mkBlock: use cgraph wrapper for allocation 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. --- diff --git a/lib/circogen/block.c b/lib/circogen/block.c index 54ebb5c34..ffcfa1df3 100644 --- a/lib/circogen/block.c +++ b/lib/circogen/block.c @@ -10,7 +10,7 @@ #include - +#include #include #include @@ -22,9 +22,7 @@ void initBlocklist(blocklist_t * bl) block_t *mkBlock(Agraph_t * g) { - block_t *sn; - - sn = NEW(block_t); + block_t *sn = gv_alloc(sizeof(block_t)); initBlocklist(&sn->children); sn->sub_graph = g; return sn;