From: Matthew Fernandez Date: Sat, 3 Sep 2022 18:03:24 +0000 (-0700) Subject: ortho make_graph: use cgraph wrappers for allocation X-Git-Tag: 6.0.1~11^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c146d744765de1b098a40f606d95c6bdcabf1ea9;p=graphviz ortho make_graph: use cgraph wrappers 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/ortho/rawgraph.c b/lib/ortho/rawgraph.c index 25e808756..1e4d7c3ef 100644 --- a/lib/ortho/rawgraph.c +++ b/lib/ortho/rawgraph.c @@ -11,7 +11,7 @@ /* Implements graph.h */ #include "config.h" - +#include #include #include #include @@ -25,9 +25,9 @@ rawgraph* make_graph(int n) { int i; - rawgraph* g = NEW(rawgraph); + rawgraph* g = gv_alloc(sizeof(rawgraph)); g->nvs = n; - g->vertices = N_NEW(n, vertex); + g->vertices = gv_calloc(n, sizeof(vertex)); for(i=0;ivertices[i].adj_list = openIntSet (); g->vertices[i].color = UNSCANNED;