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/clientattrib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/glx/clientattrib.c') diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c index 7792fa31f9d..4721fe938fd 100644 --- a/src/glx/clientattrib.c +++ b/src/glx/clientattrib.c @@ -75,7 +75,7 @@ __indirect_glPushClientAttrib(GLuint mask) if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) { if (!(sp = *spp)) { - sp = (__GLXattribute *) Xmalloc(sizeof(__GLXattribute)); + sp = (__GLXattribute *) malloc(sizeof(__GLXattribute)); *spp = sp; } sp->mask = mask; @@ -135,7 +135,7 @@ __glFreeAttributeState(struct glx_context * gc) spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) { sp = *spp; if (sp) { - XFree((char *) sp); + free((char *) sp); } else { break; -- cgit v1.2.3