]> granicus.if.org Git - graphviz/commitdiff
neatogen shortest_path: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 26 Dec 2022 05:41:23 +0000 (21:41 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 29 Jan 2023 21:27:37 +0000 (13:27 -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/neatogen/stuff.c

index d1ac1bc9974def246c1235df6bb38a88eb19d845..bb25513ef7bf38a82ffd8890ad93243456d79e6a 100644 (file)
@@ -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();