From 80ba02fec31b0e347324ecff5b926773257f0af1 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 18 Sep 2022 10:14:47 -0700 Subject: [PATCH] topfish cpExGraph: 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. --- lib/topfish/hierarchy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/topfish/hierarchy.c b/lib/topfish/hierarchy.c index f365a4470..a81e63bfb 100644 --- a/lib/topfish/hierarchy.c +++ b/lib/topfish/hierarchy.c @@ -674,15 +674,13 @@ static v_data *cpGraph(v_data * graph, int n, int nedges) static ex_vtx_data *cpExGraph(ex_vtx_data * graph, int n, int nedges) { - ex_vtx_data *cpGraph; - int *edges; int i, j; if (graph == NULL || n == 0) { return NULL; } - cpGraph = N_NEW(n, ex_vtx_data); - edges = N_NEW(2 * nedges + n, int); + ex_vtx_data *cpGraph = gv_calloc(n, sizeof(ex_vtx_data)); + int *edges = gv_calloc(2 * nedges + n, sizeof(int)); for (i = 0; i < n; i++) { cpGraph[i] = graph[i]; -- 2.40.0