From dff743ffd0acc4f1eb35216d8d620b83a76200c7 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 1 Sep 2022 18:51:33 -0700 Subject: [PATCH] smyrna initFocus: use cgraph wrapper for allocations 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. --- cmd/smyrna/hier.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/smyrna/hier.c b/cmd/smyrna/hier.c index d73149c41..6cdf6b7c5 100644 --- a/cmd/smyrna/hier.c +++ b/cmd/smyrna/hier.c @@ -13,7 +13,6 @@ #include "hier.h" #include #include -#include /* scale_coords: */ @@ -195,10 +194,10 @@ Hierarchy *makeHier(int nn, int ne, v_data * graph, double *x_coords, focus_t *initFocus(int ncnt) { - focus_t *fs = NEW(focus_t); + focus_t *fs = gv_alloc(sizeof(focus_t)); fs->num_foci = 0; - fs->foci_nodes = N_NEW(ncnt, int); - fs->x_foci = N_NEW(ncnt, double); - fs->y_foci = N_NEW(ncnt, double); + fs->foci_nodes = gv_calloc(ncnt, sizeof(int)); + fs->x_foci = gv_calloc(ncnt, sizeof(double)); + fs->y_foci = gv_calloc(ncnt, sizeof(double)); return fs; } -- 2.40.0