From 31c77cb7122c41be6be9d16b297f11b8fd420bb7 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 17 Nov 2022 17:14:41 -0800 Subject: [PATCH] neatogen makeMultiSpline: 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. --- lib/neatogen/multispline.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/neatogen/multispline.c b/lib/neatogen/multispline.c index 8f92127fc..14164fb1c 100644 --- a/lib/neatogen/multispline.c +++ b/lib/neatogen/multispline.c @@ -1253,8 +1253,6 @@ int makeMultiSpline(edge_t* e, router_t * rtr, int doPolyline) { int h_id = rtr->tn + 1; int ecnt = rtr->tg->nedges; PPQ pq; - PQTYPE *idxs; - PQVTYPE *vals; int ret; // record the number of edges in each node, so we can drop the added ones @@ -1270,8 +1268,8 @@ int makeMultiSpline(edge_t* e, router_t * rtr, int doPolyline) { /* Initialize priority queue */ PQgen(&pq.pq, rtr->tn + 2, -1); - idxs = N_GNEW(pq.pq.PQsize + 1, PQTYPE); - vals = N_GNEW(pq.pq.PQsize + 1, PQVTYPE); + PQTYPE *idxs = gv_calloc(pq.pq.PQsize + 1, sizeof(PQTYPE)); + PQVTYPE *vals = gv_calloc(pq.pq.PQsize + 1, sizeof(PQVTYPE)); vals[0] = 0; pq.vals = vals + 1; pq.idxs = idxs + 1; -- 2.50.1