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/dri2.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/dri2.c')
-rw-r--r-- | src/glx/dri2.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glx/dri2.c b/src/glx/dri2.c index d6b99db768c..1214cb47a78 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -303,7 +303,7 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName) return False; } - *driverName = Xmalloc(rep.driverNameLength + 1); + *driverName = malloc(rep.driverNameLength + 1); if (*driverName == NULL) { _XEatData(dpy, ((rep.driverNameLength + 3) & ~3) + @@ -315,9 +315,9 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName) _XReadPad(dpy, *driverName, rep.driverNameLength); (*driverName)[rep.driverNameLength] = '\0'; - *deviceName = Xmalloc(rep.deviceNameLength + 1); + *deviceName = malloc(rep.deviceNameLength + 1); if (*deviceName == NULL) { - Xfree(*driverName); + free(*driverName); _XEatData(dpy, ((rep.deviceNameLength + 3) & ~3)); UnlockDisplay(dpy); SyncHandle(); @@ -431,7 +431,7 @@ DRI2GetBuffers(Display * dpy, XID drawable, *height = rep.height; *outCount = rep.count; - buffers = Xmalloc(rep.count * sizeof buffers[0]); + buffers = malloc(rep.count * sizeof buffers[0]); if (buffers == NULL) { _XEatData(dpy, rep.count * sizeof repBuffer); UnlockDisplay(dpy); @@ -490,7 +490,7 @@ DRI2GetBuffersWithFormat(Display * dpy, XID drawable, *height = rep.height; *outCount = rep.count; - buffers = Xmalloc(rep.count * sizeof buffers[0]); + buffers = malloc(rep.count * sizeof buffers[0]); if (buffers == NULL) { _XEatData(dpy, rep.count * sizeof repBuffer); UnlockDisplay(dpy); |