]> granicus.if.org Git - graphviz/commitdiff
glcomp glCompLabelNew: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Sep 2022 00:41:23 +0000 (17:41 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Sep 2022 00:17:10 +0000 (17:17 -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/glcomp/glcomplabel.c

index ac956b35b81618d462d6b939a6d0406e64219a34..0642925b5e35cb5c901666fd3c69d7aba6a24256 100644 (file)
@@ -8,17 +8,16 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include <cgraph/alloc.h>
 #include <glcomp/glcomplabel.h>
 #include <glcomp/glcompfont.h>
 #include <glcomp/glcompset.h>
 #include <glcomp/glutils.h>
-#include <common/memory.h>
 
 glCompLabel *glCompLabelNew(glCompObj * par, GLfloat x, GLfloat y,
                            char *text)
 {
-    glCompLabel *p;
-    p = NEW(glCompLabel);
+    glCompLabel *p = gv_alloc(sizeof(glCompLabel));
     glCompInitCommon((glCompObj *) p, par, x, y);
     p->objType = glLabelObj;
     p->transparent=1;