]> granicus.if.org Git - graphviz/commitdiff
label xlnew: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 5 Sep 2022 15:48:16 +0000 (08:48 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 6 Sep 2022 14:34:33 +0000 (07:34 -0700)
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/xlabels.c

index 4574eb33448e11a19dfebb9802fbd2aa6332275a..b09c3ad926417699289247996ad2b040cd3619c8 100644 (file)
@@ -18,7 +18,6 @@
 #include <string.h>
 #define XLABEL_INT
 #include <label/xlabels.h>
-#include <common/memory.h>
 
 extern int Verbose;
 
@@ -45,7 +44,7 @@ static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
 static XLabels_t *xlnew(object_t * objs, int n_objs, xlabel_t * lbls,
                         int n_lbls, label_params_t * params)
 {
-    XLabels_t *xlp = NEW(XLabels_t);
+    XLabels_t *xlp = gv_alloc(sizeof(XLabels_t));
 
     /* used to load the rtree in hilbert space filling curve order */
     if (!(xlp->hdx = dtopen(&Hdisc, Dtobag))) {