From: Matthew Fernandez Date: Mon, 26 Dec 2022 05:41:23 +0000 (-0800) Subject: neatogen shortest_path: use cgraph wrapper for allocation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c194716f820e7cc5784d78a457d90e3d31e9dd6d;p=graphviz neatogen shortest_path: 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/neatogen/stuff.c b/lib/neatogen/stuff.c index d1ac1bc99..bb25513ef 100644 --- a/lib/neatogen/stuff.c +++ b/lib/neatogen/stuff.c @@ -651,7 +651,7 @@ void shortest_path(graph_t * G, int nG) { node_t *v; - Heap = N_NEW(nG + 1, node_t *); + Heap = gv_calloc(nG + 1, sizeof(node_t*)); if (Verbose) { fprintf(stderr, "Calculating shortest paths: "); start_timer();