From: Matthew Fernandez Date: Sun, 18 Sep 2022 17:15:39 +0000 (-0700) Subject: topfish set_active_levels: use cgraph wrappers for allocation X-Git-Tag: 6.0.2~32^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60466b05047318cf04dc8e3b59cc8a83f44cf948;p=graphviz topfish set_active_levels: 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/topfish/hierarchy.c b/lib/topfish/hierarchy.c index ef693f464..f1aa0cfd2 100644 --- a/lib/topfish/hierarchy.c +++ b/lib/topfish/hierarchy.c @@ -801,8 +801,8 @@ set_active_levels(Hierarchy * hierarchy, int *foci_nodes, int num_foci, n = hierarchy->nvtxs[min_level]; // compute distances from foci nodes - nodes = N_NEW(n, int); - distances = N_NEW(n, double); + nodes = gv_calloc(n, sizeof(int)); + distances = gv_calloc(n, sizeof(double)); for (i = 0; i < n; i++) { nodes[i] = i; distances[i] = dist_from_foci(graph, i, foci_nodes, num_foci);