]> granicus.if.org Git - graphviz/commitdiff
glcomp glCompImageNew: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Sep 2022 00:43:26 +0000 (17:43 -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/glcompimage.c

index 291a9c05295f2c2c5f60a2fbb106c2b0d23aca0b..a22f8afedfbf51b531318db291a8363aac4a5e63 100644 (file)
@@ -8,17 +8,16 @@
  * Contributors: Details at https://graphviz.org
  *************************************************************************/
 
+#include <cgraph/alloc.h>
 #include <glcomp/glcompimage.h>
 #include <glcomp/glcompfont.h>
 #include <glcomp/glcompset.h>
 #include <glcomp/glutils.h>
 #include <glcomp/glcomptexture.h>
-#include <common/memory.h>
 
 glCompImage *glCompImageNew(glCompObj * par, GLfloat x, GLfloat y)
 {
-    glCompImage *p;
-    p = NEW(glCompImage);
+    glCompImage *p = gv_alloc(sizeof(glCompImage));
     glCompInitCommon((glCompObj *) p, par, x, y);
     p->objType = glImageObj;