diff options
author | Matt Turner <[email protected]> | 2012-09-04 22:52:36 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2012-09-05 22:28:49 -0700 |
commit | 7c7b7b068b1d0dc8e14b87dab5dbd4108f874f74 (patch) | |
tree | 9a6901c4b12cd5b2dbe3c7fce29cfcc7771a84de /src/glx/indirect_glx.c | |
parent | 17a574d7cd8c541c902cc0da40362a32d965e77b (diff) |
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 <[email protected]>
Diffstat (limited to 'src/glx/indirect_glx.c')
-rw-r--r-- | src/glx/indirect_glx.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index 2399375a9bc..4f23fed3b08 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -46,17 +46,17 @@ indirect_destroy_context(struct glx_context *gc) __glXFreeVertexArrayState(gc); if (gc->vendor) - XFree((char *) gc->vendor); + free((char *) gc->vendor); if (gc->renderer) - XFree((char *) gc->renderer); + free((char *) gc->renderer); if (gc->version) - XFree((char *) gc->version); + free((char *) gc->version); if (gc->extensions) - XFree((char *) gc->extensions); + free((char *) gc->extensions); __glFreeAttributeState(gc); - XFree((char *) gc->buf); - Xfree((char *) gc->client_state_private); - XFree((char *) gc); + free((char *) gc->buf); + free((char *) gc->client_state_private); + free((char *) gc); } static Bool @@ -356,7 +356,7 @@ indirect_create_context(struct glx_screen *psc, } /* Allocate our context record */ - gc = Xmalloc(sizeof *gc); + gc = malloc(sizeof *gc); if (!gc) { /* Out of memory */ return NULL; @@ -366,10 +366,10 @@ indirect_create_context(struct glx_screen *psc, glx_context_init(gc, psc, mode); gc->isDirect = GL_FALSE; gc->vtable = &indirect_context_vtable; - state = Xmalloc(sizeof(struct __GLXattributeRec)); + state = malloc(sizeof(struct __GLXattributeRec)); if (state == NULL) { /* Out of memory */ - Xfree(gc); + free(gc); return NULL; } gc->client_state_private = state; @@ -384,10 +384,10 @@ indirect_create_context(struct glx_screen *psc, */ bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq; - gc->buf = (GLubyte *) Xmalloc(bufSize); + gc->buf = (GLubyte *) malloc(bufSize); if (!gc->buf) { - Xfree(gc->client_state_private); - Xfree(gc); + free(gc->client_state_private); + free(gc); return NULL; } gc->bufSize = bufSize; @@ -468,7 +468,7 @@ indirect_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; |