From 7c7b7b068b1d0dc8e14b87dab5dbd4108f874f74 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 4 Sep 2012 22:52:36 -0700 Subject: Remove Xcalloc/Xmalloc/Xfree calls These calls allowed Xlib to use a custom memory allocator, but Xlib has used the standard C library functions since at least its initial import into git in 2003. It seems unlikely that it will grow a custom memory allocator. The functions now just add extra overhead. Replacing them will make future Coccinelle patches simpler. This patch has been generated by the following Coccinelle semantic patch: // Remove Xcalloc/Xmalloc/Xfree calls @@ expression E1, E2; @@ - Xcalloc (E1, E2) + calloc (E1, E2) @@ expression E; @@ - Xmalloc (E) + malloc (E) @@ expression E; @@ - Xfree (E) + free (E) @@ expression E; @@ - XFree (E) + free (E) Reviewed-by: Brian Paul --- src/glx/applegl_glx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/glx/applegl_glx.c') diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 9be12b0f6b2..c3597cee765 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -134,12 +134,12 @@ applegl_create_context(struct glx_screen *psc, /* TODO: Integrate this with apple_glx_create_context and make * struct apple_glx_context inherit from struct glx_context. */ - gc = Xcalloc(1, sizeof (*gc)); + gc = calloc(1, sizeof(*gc)); if (gc == NULL) return NULL; if (!glx_context_init(gc, psc, config)) { - Xfree(gc); + free(gc); return NULL; } @@ -173,7 +173,7 @@ applegl_create_screen(int screen, struct glx_display * priv) { struct glx_screen *psc; - psc = Xmalloc(sizeof *psc); + psc = malloc(sizeof *psc); if (psc == NULL) return NULL; -- cgit v1.2.3