From ac01e4621c9fa48d63d7b5e2264e33b93ae16ea3 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 5 Sep 2022 08:48:51 -0700 Subject: [PATCH] label doxlabel: 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/label/nrtmain.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/label/nrtmain.c b/lib/label/nrtmain.c index b363aa356..d19d96061 100644 --- a/lib/label/nrtmain.c +++ b/lib/label/nrtmain.c @@ -11,9 +11,8 @@ #include #include #include - +#include #include -#include #include #include @@ -128,8 +127,8 @@ int doxlabel(opts_t * opts) } n_objs = agnnodes(gp) + n_elbls; n_lbls = n_nlbls + n_elbls; - objp = objs = N_NEW(n_objs, object_t); - xlp = lbls = N_NEW(n_lbls, xlabel_t); + objp = objs = gv_calloc(n_objs, sizeof(object_t)); + xlp = lbls = gv_calloc(n_lbls, sizeof(xlabel_t)); bb.LL = pointfof(INT_MAX, INT_MAX); bb.UR = pointfof(-INT_MAX, -INT_MAX); -- 2.50.1