summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-02-19 11:58:49 -0500
committerKristian Høgsberg <[email protected]>2010-02-19 12:03:01 -0500
commit32f2fd1c5d6088692551c80352b7d6fa35b0cd09 (patch)
tree5c44742f6d4f8711b6d1ca31d68d3245abd0187a /src/mesa/drivers
parent6bf1ea897fa470af58fe8916dff45e2da79634a3 (diff)
Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/meta.c34
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c34
-rw-r--r--src/mesa/drivers/dri/common/drirenderbuffer.c4
-rw-r--r--src/mesa/drivers/dri/common/utils.c12
-rw-r--r--src/mesa/drivers/dri/fb/fb_dri.c12
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_queryobj.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_batch.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_cache.c10
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c10
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c8
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c12
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c8
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_bitmap.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c4
-rw-r--r--src/mesa/drivers/dri/intel/intel_span.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_syncobj.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog_common.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_shader.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.c2
-rw-r--r--src/mesa/drivers/dri/r600/r700_oglprog.c2
-rw-r--r--src/mesa/drivers/dri/r600/r700_vertprog.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_buffer_objects.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_fbo.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_queryobj.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c4
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c16
-rw-r--r--src/mesa/drivers/dri/savage/savagetex.c4
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c24
-rw-r--r--src/mesa/drivers/dri/unichrome/via_fb.c6
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c22
-rw-r--r--src/mesa/drivers/glide/fxdd.c4
-rw-r--r--src/mesa/drivers/glide/fxddtex.c6
-rw-r--r--src/mesa/drivers/glide/fxsetup.c4
-rw-r--r--src/mesa/drivers/glslcompiler/glslcompiler.c4
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c12
-rw-r--r--src/mesa/drivers/windows/gdi/mesa.def2
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c8
-rw-r--r--src/mesa/drivers/windows/icd/mesa.def3
-rw-r--r--src/mesa/drivers/x11/fakeglx.c18
-rw-r--r--src/mesa/drivers/x11/xm_api.c26
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c6
44 files changed, 184 insertions, 189 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 4dd2293b24e..42ab7d4ed60 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -307,7 +307,7 @@ _mesa_meta_free(GLcontext *ctx)
* freed by the normal context destruction code. But this would be
* the place to free other meta data someday.
*/
- _mesa_free(ctx->Meta);
+ free(ctx->Meta);
ctx->Meta = NULL;
}
@@ -1304,7 +1304,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx,
}
if (mask & GL_DEPTH_BUFFER_BIT) {
- GLuint *tmp = (GLuint *) _mesa_malloc(srcW * srcH * sizeof(GLuint));
+ GLuint *tmp = (GLuint *) malloc(srcW * srcH * sizeof(GLuint));
if (tmp) {
if (!blit->DepthFP)
init_blit_depth_pixels(ctx);
@@ -1328,7 +1328,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx,
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
mask &= ~GL_DEPTH_BUFFER_BIT;
- _mesa_free(tmp);
+ free(tmp);
}
}
@@ -2065,7 +2065,7 @@ _mesa_meta_Bitmap(GLcontext *ctx,
if (!bitmap1)
return;
- bitmap8 = (GLubyte *) _mesa_calloc(width * height);
+ bitmap8 = (GLubyte *) calloc(1, width * height);
if (bitmap8) {
_mesa_expand_bitmap(width, height, &unpackSave, bitmap1,
bitmap8, width, 0xff);
@@ -2082,7 +2082,7 @@ _mesa_meta_Bitmap(GLcontext *ctx,
_mesa_set_enable(ctx, tex->Target, GL_FALSE);
- _mesa_free(bitmap8);
+ free(bitmap8);
}
_mesa_unmap_pbo_source(ctx, &unpackSave);
@@ -2531,7 +2531,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
/*
* Alloc image buffer (XXX could use a PBO)
*/
- buf = _mesa_malloc(width * height * bpp);
+ buf = malloc(width * height * bpp);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
return;
@@ -2592,7 +2592,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
_mesa_lock_texture(ctx, texObj); /* re-lock */
- _mesa_free(buf);
+ free(buf);
}
@@ -2647,7 +2647,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
/*
* Alloc image buffer (XXX could use a PBO)
*/
- buf = _mesa_malloc(width * height * bpp);
+ buf = malloc(width * height * bpp);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage%uD", dims);
return;
@@ -2688,7 +2688,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
_mesa_lock_texture(ctx, texObj); /* re-lock */
- _mesa_free(buf);
+ free(buf);
}
@@ -2731,7 +2731,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable");
return;
@@ -2748,7 +2748,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
@@ -2758,7 +2758,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable");
return;
@@ -2775,7 +2775,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
@@ -2786,7 +2786,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D");
return;
@@ -2805,7 +2805,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
@@ -2816,7 +2816,7 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D");
return;
@@ -2836,5 +2836,5 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 58a94b58682..9142dd72f5a 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -242,12 +242,12 @@ __driUtilUpdateDrawableInfo(__DRIdrawable *pdp)
}
if (pdp->pClipRects) {
- _mesa_free(pdp->pClipRects);
+ free(pdp->pClipRects);
pdp->pClipRects = NULL;
}
if (pdp->pBackClipRects) {
- _mesa_free(pdp->pBackClipRects);
+ free(pdp->pBackClipRects);
pdp->pBackClipRects = NULL;
}
@@ -324,7 +324,7 @@ static void driSwapBuffers(__DRIdrawable *dPriv)
if (!dPriv->numClipRects)
return;
- rects = _mesa_malloc(sizeof(*rects) * dPriv->numClipRects);
+ rects = malloc(sizeof(*rects) * dPriv->numClipRects);
if (!rects)
return;
@@ -337,7 +337,7 @@ static void driSwapBuffers(__DRIdrawable *dPriv)
}
driReportDamage(dPriv, rects, dPriv->numClipRects);
- _mesa_free(rects);
+ free(rects);
}
static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv,
@@ -430,7 +430,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
*/
(void) attrs;
- pdp = _mesa_malloc(sizeof *pdp);
+ pdp = malloc(sizeof *pdp);
if (!pdp) {
return NULL;
}
@@ -457,7 +457,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes,
renderType == GLX_PIXMAP_BIT)) {
- _mesa_free(pdp);
+ free(pdp);
return NULL;
}
@@ -510,14 +510,14 @@ static void dri_put_drawable(__DRIdrawable *pdp)
psp = pdp->driScreenPriv;
(*psp->DriverAPI.DestroyBuffer)(pdp);
if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
- _mesa_free(pdp->pClipRects);
+ free(pdp->pClipRects);
pdp->pClipRects = NULL;
}
if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) {
- _mesa_free(pdp->pBackClipRects);
+ free(pdp->pBackClipRects);
pdp->pBackClipRects = NULL;
}
- _mesa_free(pdp);
+ free(pdp);
}
}
@@ -547,7 +547,7 @@ driDestroyContext(__DRIcontext *pcp)
{
if (pcp) {
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
- _mesa_free(pcp);
+ free(pcp);
}
}
@@ -577,7 +577,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
__DRIcontext *pcp;
void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL;
- pcp = _mesa_malloc(sizeof *pcp);
+ pcp = malloc(sizeof *pcp);
if (!pcp)
return NULL;
@@ -602,7 +602,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config,
pcp->hHWContext = hwContext;
if ( !(*psp->DriverAPI.CreateContext)(&config->modes, pcp, shareCtx) ) {
- _mesa_free(pcp);
+ free(pcp);
return NULL;
}
@@ -656,7 +656,7 @@ static void driDestroyScreen(__DRIscreen *psp)
(void)drmCloseOnce(psp->fd);
}
- _mesa_free(psp);
+ free(psp);
}
}
@@ -718,7 +718,7 @@ driCreateNewScreen(int scrn,
static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
- psp = _mesa_calloc(sizeof *psp);
+ psp = calloc(1, sizeof *psp);
if (!psp)
return NULL;
@@ -763,7 +763,7 @@ driCreateNewScreen(int scrn,
*driver_modes = driDriverAPI.InitScreen(psp);
if (*driver_modes == NULL) {
- _mesa_free(psp);
+ free(psp);
return NULL;
}
@@ -785,7 +785,7 @@ dri2CreateNewScreen(int scrn, int fd,
if (driDriverAPI.InitScreen2 == NULL)
return NULL;
- psp = _mesa_calloc(sizeof(*psp));
+ psp = calloc(1, sizeof(*psp));
if (!psp)
return NULL;
@@ -807,7 +807,7 @@ dri2CreateNewScreen(int scrn, int fd,
psp->DriverAPI = driDriverAPI;
*driver_configs = driDriverAPI.InitScreen2(psp);
if (*driver_configs == NULL) {
- _mesa_free(psp);
+ free(psp);
return NULL;
}
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c
index fe38f608a97..48a2c662297 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.c
@@ -32,7 +32,7 @@ driDeleteRenderbuffer(struct gl_renderbuffer *rb)
/* don't free rb->Data Chances are it's a memory mapped region for
* the dri drivers.
*/
- _mesa_free(rb);
+ free(rb);
}
@@ -70,7 +70,7 @@ driNewRenderbuffer(gl_format format, GLvoid *addr,
assert(cpp > 0);
assert(pitch > 0);
- drb = _mesa_calloc(sizeof(driRenderbuffer));
+ drb = calloc(1, sizeof(driRenderbuffer));
if (drb) {
const GLuint name = 0;
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 833f9ad232a..8c15cbbf735 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -108,7 +108,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
cpu = _mesa_get_cpu_string();
if (cpu) {
offset += sprintf(buffer + offset, " %s", cpu);
- _mesa_free(cpu);
+ free(cpu);
}
return offset;
@@ -559,7 +559,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
}
num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes;
- configs = _mesa_calloc((num_modes + 1) * sizeof *configs);
+ configs = calloc(1, (num_modes + 1) * sizeof *configs);
if (configs == NULL)
return NULL;
@@ -568,7 +568,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
for ( i = 0 ; i < num_db_modes ; i++ ) {
for ( h = 0 ; h < num_msaa_modes; h++ ) {
for ( j = 0 ; j < num_accum_bits ; j++ ) {
- *c = _mesa_malloc (sizeof **c);
+ *c = malloc (sizeof **c);
modes = &(*c)->modes;
c++;
@@ -653,7 +653,7 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a,
while (b[j] != NULL)
j++;
- all = _mesa_malloc((i + j + 1) * sizeof *all);
+ all = malloc((i + j + 1) * sizeof *all);
index = 0;
for (i = 0; a[i] != NULL; i++)
all[index++] = a[i];
@@ -661,8 +661,8 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a,
all[index++] = b[j];
all[index++] = NULL;
- _mesa_free(a);
- _mesa_free(b);
+ free(a);
+ free(b);
return all;
}
diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c
index 0675bb9894f..ac07e57db13 100644
--- a/src/mesa/drivers/dri/fb/fb_dri.c
+++ b/src/mesa/drivers/dri/fb/fb_dri.c
@@ -340,7 +340,7 @@ fbCreateContext( const __GLcontextModes *glVisual,
assert(driContextPriv);
/* Allocate the Fb context */
- fbmesa = (fbContextPtr) _mesa_calloc( sizeof(*fbmesa) );
+ fbmesa = (fbContextPtr) calloc(1, sizeof(*fbmesa) );
if ( !fbmesa )
return GL_FALSE;
@@ -358,7 +358,7 @@ fbCreateContext( const __GLcontextModes *glVisual,
ctx = fbmesa->glCtx = _mesa_create_context(glVisual, shareCtx,
&functions, (void *) fbmesa);
if (!fbmesa->glCtx) {
- _mesa_free(fbmesa);
+ free(fbmesa);
return GL_FALSE;
}
driContextPriv->driverPrivate = fbmesa;
@@ -406,7 +406,7 @@ fbDestroyContext( __DRIcontext *driContextPriv )
fbmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context( fbmesa->glCtx );
- _mesa_free( fbmesa );
+ free( fbmesa );
}
}
@@ -449,7 +449,7 @@ fbCreateBuffer( __DRIscreen *driScrnPriv,
}
if (mesaVis->doubleBufferMode) {
/* XXX what are the correct origin/stride values? */
- GLvoid *backBuf = _mesa_malloc(driScrnPriv->fbStride
+ GLvoid *backBuf = malloc(driScrnPriv->fbStride
* driScrnPriv->fbHeight);
driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
backBuf,
@@ -503,7 +503,7 @@ fbSwapBuffers( __DRIdrawable *dPriv )
if (ctx->Visual.doubleBufferMode) {
int i;
int offset = 0;
- char *tmp = _mesa_malloc(currentPitch);
+ char *tmp = malloc(currentPitch);
_mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
@@ -516,7 +516,7 @@ fbSwapBuffers( __DRIdrawable *dPriv )
offset += currentPitch;
}
- _mesa_free(tmp);
+ free(tmp);
}
}
else {
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index 6cb8edb611f..cb9cd836a07 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -199,7 +199,7 @@ static void prepare_constant_buffer(struct brw_context *brw)
return;
}
- buf = (GLfloat *) _mesa_calloc(bufsz);
+ buf = (GLfloat *) calloc(1, bufsz);
/* fragment shader constants */
if (brw->curbe.wm_size) {
@@ -294,12 +294,12 @@ static void prepare_constant_buffer(struct brw_context *brw)
bufsz == brw->curbe.last_bufsz &&
memcmp(buf, brw->curbe.last_buf, bufsz) == 0) {
/* constants have not changed */
- _mesa_free(buf);
+ free(buf);
}
else {
/* constants have changed */
if (brw->curbe.last_buf)
- _mesa_free(brw->curbe.last_buf);
+ free(brw->curbe.last_buf);
brw->curbe.last_buf = buf;
brw->curbe.last_bufsz = bufsz;
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index c46b9ba89ce..ceaeb923b05 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -320,7 +320,7 @@ copy_array_to_vbo_array( struct brw_context *brw,
} else {
void *data;
- data = _mesa_malloc(dst_stride * element->count);
+ data = malloc(dst_stride * element->count);
dest = data;
for (i = 0; i < element->count; i++) {
memcpy(dest, src, dst_stride);
@@ -333,7 +333,7 @@ copy_array_to_vbo_array( struct brw_context *brw,
size,
data);
- _mesa_free(data);
+ free(data);
}
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index 1df561386e6..4e7c1226ad4 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -237,7 +237,7 @@ brw_resolve_cals(struct brw_compile *c)
struct brw_glsl_call *call, *next;
for (call = c->first_call; call; call = next) {
next = call->next;
- _mesa_free(call);
+ free(call);
}
c->first_call = NULL;
}
@@ -247,7 +247,7 @@ brw_resolve_cals(struct brw_compile *c)
struct brw_glsl_label *label, *next;
for (label = c->first_label; label; label = next) {
next = label->next;
- _mesa_free(label);
+ free(label);
}
c->first_label = NULL;
}
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index 5399a742449..6cce7e50890 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -73,7 +73,7 @@ brw_new_query_object(GLcontext *ctx, GLuint id)
{
struct brw_query_object *query;
- query = _mesa_calloc(sizeof(struct brw_query_object));
+ query = calloc(1, sizeof(struct brw_query_object));
query->Base.Id = id;
query->Base.Result = 0;
@@ -89,7 +89,7 @@ brw_delete_query(GLcontext *ctx, struct gl_query_object *q)
struct brw_query_object *query = (struct brw_query_object *)q;
dri_bo_unreference(query->bo);
- _mesa_free(query);
+ free(query);
}
static void
diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c
index ed8120d617f..39019412fda 100644
--- a/src/mesa/drivers/dri/i965/brw_state_batch.c
+++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
@@ -57,8 +57,8 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw,
if (item->sz == sz && memcmp(item->header, newheader, sz) == 0)
return GL_FALSE;
if (item->sz != sz) {
- _mesa_free(item->header);
- item->header = _mesa_malloc(sz);
+ free(item->header);
+ item->header = malloc(sz);
item->sz = sz;
}
goto emit;
@@ -68,7 +68,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw,
assert(!item);
item = CALLOC_STRUCT(brw_cached_batch_item);
- item->header = _mesa_malloc(sz);
+ item->header = malloc(sz);
item->sz = sz;
item->next = brw->cached_batch_items;
brw->cached_batch_items = item;
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index 1369d97e21b..dd9894d6819 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -150,7 +150,7 @@ rehash(struct brw_cache *cache)
GLuint size, i;
size = cache->size * 3;
- items = (struct brw_cache_item**) _mesa_calloc(size * sizeof(*items));
+ items = (struct brw_cache_item**) calloc(1, size * sizeof(*items));
for (i = 0; i < cache->size; i++)
for (c = cache->items[i]; c; c = next) {
@@ -237,7 +237,7 @@ brw_upload_cache_with_auxdata(struct brw_cache *cache,
/* Set up the memory containing the key, aux_data, and reloc_bufs */
- tmp = _mesa_malloc(key_size + aux_size + relocs_size);
+ tmp = malloc(key_size + aux_size + relocs_size);
memcpy(tmp, key, key_size);
memcpy(tmp + key_size, aux, aux_size);
@@ -366,7 +366,7 @@ brw_init_non_surface_cache(struct brw_context *brw)
cache->size = 7;
cache->n_items = 0;
cache->items = (struct brw_cache_item **)
- _mesa_calloc(cache->size * sizeof(struct brw_cache_item));
+ calloc(1, cache->size * sizeof(struct brw_cache_item));
brw_init_cache_id(cache, "CC_VP", BRW_CC_VP);
brw_init_cache_id(cache, "CC_UNIT", BRW_CC_UNIT);
@@ -403,7 +403,7 @@ brw_init_surface_cache(struct brw_context *brw)
cache->size = 7;
cache->n_items = 0;
cache->items = (struct brw_cache_item **)
- _mesa_calloc(cache->size * sizeof(struct brw_cache_item));
+ calloc(1, cache->size * sizeof(struct brw_cache_item));
brw_init_cache_id(cache, "SS_SURFACE", BRW_SS_SURFACE);
brw_init_cache_id(cache, "SS_SURF_BIND", BRW_SS_SURF_BIND);
@@ -444,7 +444,7 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache)
cache->n_items = 0;
if (brw->curbe.last_buf) {
- _mesa_free(brw->curbe.last_buf);
+ free(brw->curbe.last_buf);
brw->curbe.last_buf = NULL;
}
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index 681319dedfd..0b0be02dd20 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -67,11 +67,11 @@ static void brw_destroy_context( struct intel_context *intel )
brw_draw_destroy( brw );
brw_clear_validated_bos(brw);
if (brw->wm.compile_data) {
- _mesa_free(brw->wm.compile_data->instruction);
- _mesa_free(brw->wm.compile_data->vreg);
- _mesa_free(brw->wm.compile_data->refs);
- _mesa_free(brw->wm.compile_data->prog_instructions);
- _mesa_free(brw->wm.compile_data);
+ free(brw->wm.compile_data->instruction);
+ free(brw->wm.compile_data->vreg);
+ free(brw->wm.compile_data->refs);
+ free(brw->wm.compile_data->prog_instructions);
+ free(brw->wm.compile_data);
}
for (i = 0; i < brw->state.nr_color_regions; i++)
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 9191c81755d..991e1b964b8 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -151,11 +151,11 @@ static void do_wm_prog( struct brw_context *brw,
*/
return;
}
- c->instruction = _mesa_calloc(BRW_WM_MAX_INSN * sizeof(*c->instruction));
- c->prog_instructions = _mesa_calloc(BRW_WM_MAX_INSN *
+ c->instruction = calloc(1, BRW_WM_MAX_INSN * sizeof(*c->instruction));
+ c->prog_instructions = calloc(1, BRW_WM_MAX_INSN *
sizeof(*c->prog_instructions));
- c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg));
- c->refs = _mesa_calloc(BRW_WM_MAX_REF * sizeof(*c->refs));
+ c->vreg = calloc(1, BRW_WM_MAX_VREG * sizeof(*c->vreg));
+ c->refs = calloc(1, BRW_WM_MAX_REF * sizeof(*c->refs));
} else {
void *instruction = c->instruction;
void *prog_instructions = c->prog_instructions;
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 3b7015b5ad3..312866d865d 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -113,7 +113,7 @@ intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj)
if (obj->Pointer)
intel_bufferobj_unmap(ctx, 0, obj);
- _mesa_free(intel_obj->sys_buffer);
+ free(intel_obj->sys_buffer);
if (intel_obj->region) {
intel_bufferobj_release_region(intel, intel_obj);
}
@@ -121,7 +121,7 @@ intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj)
dri_bo_unreference(intel_obj->buffer);
}
- _mesa_free(intel_obj);
+ free(intel_obj);
}
@@ -155,7 +155,7 @@ intel_bufferobj_data(GLcontext * ctx,
dri_bo_unreference(intel_obj->buffer);
intel_obj->buffer = NULL;
}
- _mesa_free(intel_obj->sys_buffer);
+ free(intel_obj->sys_buffer);
intel_obj->sys_buffer = NULL;
if (size != 0) {
@@ -164,7 +164,7 @@ intel_bufferobj_data(GLcontext * ctx,
* with their contents anyway.
*/
if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) {
- intel_obj->sys_buffer = _mesa_malloc(size);
+ intel_obj->sys_buffer = malloc(size);
if (intel_obj->sys_buffer != NULL) {
if (data != NULL)
memcpy(intel_obj->sys_buffer, data, size);
@@ -373,7 +373,7 @@ intel_bufferobj_map_range(GLcontext * ctx,
if ((access & GL_MAP_INVALIDATE_RANGE_BIT) &&
drm_intel_bo_busy(intel_obj->buffer)) {
if (access & GL_MAP_FLUSH_EXPLICIT_BIT) {
- intel_obj->range_map_buffer = _mesa_malloc(length);
+ intel_obj->range_map_buffer = malloc(length);
obj->Pointer = intel_obj->range_map_buffer;
} else {
intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr,
@@ -523,7 +523,7 @@ intel_bufferobj_buffer(struct intel_context *intel,
intel_obj->Base.Size,
sys_buffer,
&intel_obj->Base);
- _mesa_free(sys_buffer);
+ free(sys_buffer);
intel_obj->sys_buffer = NULL;
}
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index d58ffd95fa6..40b867971d7 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -71,13 +71,13 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb)
ASSERT(irb);
if (irb->span_cache != NULL)
- _mesa_free(irb->span_cache);
+ free(irb->span_cache);
if (intel && irb->region) {
intel_region_release(&irb->region);
}
- _mesa_free(irb);
+ free(irb);
}
@@ -316,7 +316,7 @@ intel_create_renderbuffer(gl_format format)
default:
_mesa_problem(NULL,
"Unexpected intFormat in intel_create_renderbuffer");
- _mesa_free(irb);
+ free(irb);
return NULL;
}
@@ -468,7 +468,7 @@ intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage)
irb->Base.ClassID = INTEL_RB_CLASS;
if (!intel_update_wrapper(ctx, irb, texImage)) {
- _mesa_free(irb);
+ free(irb);
return NULL;
}
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
index eabfbf4af94..54998a63f66 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
@@ -395,7 +395,7 @@ intel_texture_bitmap(GLcontext * ctx,
}
/* Convert the A1 bitmap to an A8 format suitable for glTexImage */
- a8_bitmap = _mesa_calloc(width * height);
+ a8_bitmap = calloc(1, width * height);
_mesa_expand_bitmap(width, height, unpack, bitmap, a8_bitmap, width, 0xff);
if (_mesa_is_bufferobj(unpack->BufferObj)) {
@@ -430,7 +430,7 @@ intel_texture_bitmap(GLcontext * ctx,
_mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 1);
_mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0,
GL_ALPHA, GL_UNSIGNED_BYTE, a8_bitmap);
- _mesa_free(a8_bitmap);
+ free(a8_bitmap);
meta_set_fragment_program(&intel->meta, &intel->meta.bitmap_fp, fp);
_mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0,
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index 10177228bd8..bd1dd13fb7d 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -147,7 +147,7 @@ intel_stencil_drawpixels(GLcontext * ctx,
/* Unpack the supplied stencil values into a ubyte buffer. */
assert(sizeof(GLstencil) == sizeof(GLubyte));
- stencil_pixels = _mesa_malloc(width * height * sizeof(GLstencil));
+ stencil_pixels = malloc(width * height * sizeof(GLstencil));
for (row = 0; row < height; row++) {
GLvoid *source = _mesa_image_address2d(unpack, pixels,
width, height,
@@ -201,7 +201,7 @@ intel_stencil_drawpixels(GLcontext * ctx,
_mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, width, height, 0,
GL_RED, GL_UNSIGNED_BYTE, stencil_pixels);
ctx->Unpack = old_unpack;
- _mesa_free(stencil_pixels);
+ free(stencil_pixels);
meta_set_passthrough_transform(&intel->meta);
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 97bb97265fb..0072bb15fc3 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -49,7 +49,7 @@ static void
get_span_cache(struct intel_renderbuffer *irb, uint32_t offset)
{
if (irb->span_cache == NULL) {
- irb->span_cache = _mesa_malloc(SPAN_CACHE_SIZE);
+ irb->span_cache = malloc(SPAN_CACHE_SIZE);
irb->span_cache_offset = -1;
}
diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c
index 0d7889d3c25..d67f0cb4a68 100644
--- a/src/mesa/drivers/dri/intel/intel_syncobj.c
+++ b/src/mesa/drivers/dri/intel/intel_syncobj.c
@@ -50,7 +50,7 @@ intel_new_sync_object(GLcontext *ctx, GLuint id)
{
struct intel_sync_object *sync;
- sync = _mesa_calloc(sizeof(struct intel_sync_object));
+ sync = calloc(1, sizeof(struct intel_sync_object));
return &sync->Base;
}
@@ -61,7 +61,7 @@ intel_delete_sync_object(GLcontext *ctx, struct gl_sync_object *s)
struct intel_sync_object *sync = (struct intel_sync_object *)s;
drm_intel_bo_unreference(sync->bo);
- _mesa_free(sync);
+ free(sync);
}
static void
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
index acc66e0ae02..a5810ee500d 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
@@ -277,7 +277,7 @@ struct r300_fragment_program *r300SelectAndTranslateFragmentShader(GLcontext *ct
fp = fp->next;
}
- fp = _mesa_calloc(sizeof(struct r300_fragment_program));
+ fp = calloc(1, sizeof(struct r300_fragment_program));
fp->state = state;
diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c
index 3638010e486..9c24166ec5b 100644
--- a/src/mesa/drivers/dri/r300/r300_shader.c
+++ b/src/mesa/drivers/dri/r300/r300_shader.c
@@ -39,7 +39,7 @@ static void freeFragProgCache(GLcontext *ctx, struct r300_fragment_program_cont
while (fp) {
tmp = fp->next;
rc_constants_destroy(&fp->code.constants);
- _mesa_free(fp);
+ free(fp);
fp = tmp;
}
}
@@ -52,7 +52,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r300_vertex_program_cont *c
tmp = vp->next;
rc_constants_destroy(&vp->code.constants);
_mesa_reference_vertprog(ctx, &vp->Base, NULL);
- _mesa_free(vp);
+ free(vp);
vp = tmp;
}
}
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c
index a74b7001dd9..6a366b438b8 100644
--- a/src/mesa/drivers/dri/r300/r300_vertprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertprog.c
@@ -233,7 +233,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx,
struct r300_vertex_program *vp;
struct r300_vertex_program_compiler compiler;
- vp = _mesa_calloc(sizeof(*vp));
+ vp = calloc(1, sizeof(*vp));
vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp);
memcpy(&vp->key, wanted_key, sizeof(vp->key));
diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c
index 2a50361199b..b7124e644a3 100644
--- a/src/mesa/drivers/dri/r600/r700_oglprog.c
+++ b/src/mesa/drivers/dri/r600/r700_oglprog.c
@@ -53,7 +53,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *c
Clean_Up_Shader(&(vp->r700Shader));
_mesa_reference_vertprog(ctx, &vp->mesa_program, NULL);
- _mesa_free(vp);
+ free(vp);
vp = tmp;
}
}
diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c
index 46481cdff4e..07e0adc8905 100644
--- a/src/mesa/drivers/dri/r600/r700_vertprog.c
+++ b/src/mesa/drivers/dri/r600/r700_vertprog.c
@@ -307,7 +307,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx,
struct r700_vertex_program *vp;
unsigned int i;
- vp = _mesa_calloc(sizeof(*vp));
+ vp = calloc(1, sizeof(*vp));
vp->mesa_program = _mesa_clone_vertex_program(ctx, mesa_vp);
if (mesa_vp->IsPositionInvariant)
diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
index bc5915d3e43..0897dafbd8b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
+++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
@@ -70,7 +70,7 @@ radeonDeleteBufferObject(GLcontext * ctx,
radeon_bo_unref(radeon_obj->bo);
}
- _mesa_free(radeon_obj);
+ free(radeon_obj);
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 56dcc50785c..a8931e8478d 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -66,7 +66,7 @@ radeon_delete_renderbuffer(struct gl_renderbuffer *rb)
if (rrb && rrb->bo) {
radeon_bo_unref(rrb->bo);
}
- _mesa_free(rrb);
+ free(rrb);
}
static void *
@@ -511,7 +511,7 @@ radeon_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage)
rrb->base.ClassID = RADEON_RB_CLASS;
if (!radeon_update_wrapper(ctx, rrb, texImage)) {
- _mesa_free(rrb);
+ free(rrb);
return NULL;
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
index d0dcf0e431a..04ce12493e6 100644
--- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c
+++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c
@@ -81,7 +81,7 @@ static struct gl_query_object * radeonNewQueryObject(GLcontext *ctx, GLuint id)
{
struct radeon_query_object *query;
- query = _mesa_calloc(sizeof(struct radeon_query_object));
+ query = calloc(1, sizeof(struct radeon_query_object));
query->Base.Id = id;
query->Base.Result = 0;
@@ -103,7 +103,7 @@ static void radeonDeleteQuery(GLcontext *ctx, struct gl_query_object *q)
radeon_bo_unref(query->bo);
}
- _mesa_free(query);
+ free(query);
}
static void radeonWaitQuery(GLcontext *ctx, struct gl_query_object *q)
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 9b9d90bdd02..ff37fd3e86e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -637,7 +637,7 @@ static GLuint * allocate_image_offsets(GLcontext *ctx,
int i;
GLuint *offsets;
- offsets = _mesa_malloc(depth * sizeof(GLuint)) ;
+ offsets = malloc(depth * sizeof(GLuint)) ;
if (!offsets) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTex[Sub]Image");
return NULL;
@@ -736,7 +736,7 @@ static void radeon_store_teximage(GLcontext* ctx, int dims,
}
if (dims == 3) {
- _mesa_free(dstImageOffsets);
+ free(dstImageOffsets);
}
radeon_teximage_unmap(image);
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index 74a001b7898..6f07ac275e8 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -179,7 +179,7 @@ savageInitDriver(__DRIscreen *sPriv)
}
/* Allocate the private area */
- savageScreen = (savageScreenPrivate *)_mesa_malloc(sizeof(savageScreenPrivate));
+ savageScreen = (savageScreenPrivate *)malloc(sizeof(savageScreenPrivate));
if (!savageScreen)
return GL_FALSE;
@@ -226,7 +226,7 @@ savageInitDriver(__DRIscreen *sPriv)
savageScreen->agpTextures.handle,
savageScreen->agpTextures.size,
(drmAddress *)&(savageScreen->agpTextures.map)) != 0) {
- _mesa_free(savageScreen);
+ free(savageScreen);
sPriv->private = NULL;
return GL_FALSE;
}
@@ -246,7 +246,7 @@ savageInitDriver(__DRIscreen *sPriv)
savageScreen->aperture.size,
(drmAddress *)&savageScreen->aperture.map) != 0)
{
- _mesa_free(savageScreen);
+ free(savageScreen);
sPriv->private = NULL;
return GL_FALSE;
}
@@ -282,7 +282,7 @@ savageDestroyScreen(__DRIscreen *sPriv)
/* free all option information */
driDestroyOptionInfo (&savageScreen->optionCache);
- _mesa_free(savageScreen);
+ free(savageScreen);
sPriv->private = NULL;
}
@@ -300,7 +300,7 @@ savageCreateContext( const __GLcontextModes *mesaVis,
savageScreen->sarea_priv_offset);
int textureSize[SAVAGE_NR_TEX_HEAPS];
int i;
- imesa = (savageContextPtr)_mesa_calloc(sizeof(savageContext));
+ imesa = (savageContextPtr)calloc(1, sizeof(savageContext));
if (!imesa) {
return GL_FALSE;
}
@@ -317,7 +317,7 @@ savageCreateContext( const __GLcontextModes *mesaVis,
shareCtx = NULL;
ctx = _mesa_create_context(mesaVis, shareCtx, &functions, imesa);
if (!ctx) {
- _mesa_free(imesa);
+ free(imesa);
return GL_FALSE;
}
driContextPriv->driverPrivate = imesa;
@@ -436,7 +436,7 @@ savageCreateContext( const __GLcontextModes *mesaVis,
if (ctx->Const.MaxTextureLevels <= 6) { /*spec requires at least 64x64*/
__driUtilMessage("Not enough texture memory. "
"Falling back to indirect rendering.");
- _mesa_free(imesa);
+ free(imesa);
return GL_FALSE;
}
@@ -574,7 +574,7 @@ savageDestroyContext(__DRIcontext *driContextPriv)
_mesa_destroy_context(imesa->glCtx);
/* no longer use vertex_dma_buf*/
- _mesa_free(imesa);
+ free(imesa);
}
}
diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c
index 394be44eac5..1a748ee1264 100644
--- a/src/mesa/drivers/dri/savage/savagetex.c
+++ b/src/mesa/drivers/dri/savage/savagetex.c
@@ -603,7 +603,7 @@ _savage_texstore_a1114444(TEXSTORE_PARAMS)
dstRow += dstRowStride;
}
}
- _mesa_free((void *) tempImage);
+ free((void *) tempImage);
return GL_TRUE;
}
@@ -643,7 +643,7 @@ _savage_texstore_a1118888(TEXSTORE_PARAMS)
dstRow += dstRowStride;
}
}
- _mesa_free((void *) tempImage);
+ free((void *) tempImage);
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 40535b03b95..b2e7df34e82 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -155,7 +155,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
TRACE;
- psp = _mesa_calloc(sizeof(*psp));
+ psp = calloc(1, sizeof(*psp));
if (!psp)
return NULL;
@@ -184,7 +184,7 @@ static void driDestroyScreen(__DRIscreen *psp)
TRACE;
if (psp) {
- _mesa_free(psp);
+ free(psp);
}
}
@@ -241,8 +241,8 @@ swrast_delete_renderbuffer(struct gl_renderbuffer *rb)
{
TRACE;
- _mesa_free(rb->Data);
- _mesa_free(rb);
+ free(rb->Data);
+ free(rb);
}
static GLboolean
@@ -272,11 +272,11 @@ swrast_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
TRACE;
- _mesa_free(rb->Data);
+ free(rb->Data);
swrast_alloc_front_storage(ctx, rb, internalFormat, width, height);
- rb->Data = _mesa_malloc(height * xrb->pitch);
+ rb->Data = malloc(height * xrb->pitch);
return GL_TRUE;
}
@@ -284,7 +284,7 @@ swrast_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
static struct swrast_renderbuffer *
swrast_new_renderbuffer(const GLvisual *visual, GLboolean front)
{
- struct swrast_renderbuffer *xrb = _mesa_calloc(sizeof *xrb);
+ struct swrast_renderbuffer *xrb = calloc(1, sizeof *xrb);
GLuint pixel_format;
TRACE;
@@ -358,7 +358,7 @@ driCreateNewDrawable(__DRIscreen *screen,
TRACE;
- buf = _mesa_calloc(sizeof *buf);
+ buf = calloc(1, sizeof *buf);
if (!buf)
return NULL;
@@ -366,7 +366,7 @@ driCreateNewDrawable(__DRIscreen *screen,
buf->driScreenPriv = screen;
- buf->row = _mesa_malloc(MAX_WIDTH * 4);
+ buf->row = malloc(MAX_WIDTH * 4);
/* basic framebuffer setup */
_mesa_initialize_window_framebuffer(&buf->Base, &config->modes);
@@ -401,7 +401,7 @@ driDestroyDrawable(__DRIdrawable *buf)
if (buf) {
struct gl_framebuffer *fb = &buf->Base;
- _mesa_free(buf->row);
+ free(buf->row);
fb->DeletePending = GL_TRUE;
_mesa_reference_framebuffer(&fb, NULL);
@@ -525,7 +525,7 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
TRACE;
- ctx = _mesa_calloc(sizeof *ctx);
+ ctx = calloc(1, sizeof *ctx);
if (!ctx)
return NULL;
@@ -540,7 +540,7 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
if (!_mesa_initialize_context(&ctx->Base, &config->modes,
shared ? &shared->Base : NULL,
&functions, (void *) ctx)) {
- _mesa_free(ctx);
+ free(ctx);
return NULL;
}
diff --git a/src/mesa/drivers/dri/unichrome/via_fb.c b/src/mesa/drivers/dri/unichrome/via_fb.c
index e4fb29f6c60..bebf0619d0b 100644
--- a/src/mesa/drivers/dri/unichrome/via_fb.c
+++ b/src/mesa/drivers/dri/unichrome/via_fb.c
@@ -156,7 +156,7 @@ via_alloc_texture(struct via_context *vmesa,
}
else if (t->memType == VIA_MEM_SYSTEM) {
- t->bufAddr = _mesa_malloc(t->size);
+ t->bufAddr = malloc(t->size);
if (!t->bufAddr)
goto cleanup;
@@ -226,8 +226,8 @@ via_free_texture(struct via_context *vmesa, struct via_tex_buffer *t)
else if (t->memType == VIA_MEM_SYSTEM) {
remove_from_list(t);
vmesa->total_alloc[t->memType] -= t->size;
- _mesa_free(t->bufAddr);
- _mesa_free(t);
+ free(t->bufAddr);
+ free(t);
}
else if (t->index && viaCheckBreadcrumb(vmesa, t->lastUsed)) {
via_do_free_texture( vmesa, t );
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 49002512aa3..4e369ceac40 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -392,7 +392,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
break;
default:
/* unexpected token */
- _mesa_free(vis);
+ free(vis);
return NULL;
}
}
@@ -431,7 +431,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
}
else {
_mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n");
- _mesa_free(vis);
+ free(vis);
return NULL;
}
}
@@ -445,7 +445,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
}
else {
_mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n");
- _mesa_free(vis);
+ free(vis);
return NULL;
}
}
@@ -457,7 +457,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
accumBlueBits, accumAlphaBits,
numSamples)) {
/* something was invalid */
- _mesa_free(vis);
+ free(vis);
return NULL;
}
@@ -469,7 +469,7 @@ void
glFBDevDestroyVisual( GLFBDevVisualPtr visual )
{
if (visual)
- _mesa_free(visual);
+ free(visual);
}
@@ -488,9 +488,9 @@ delete_renderbuffer(struct gl_renderbuffer *rb)
{
struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb;
if (frb->mallocedBuffer) {
- _mesa_free(frb->Base.Data);
+ free(frb->Base.Data);
}
- _mesa_free(frb);
+ free(frb);
}
@@ -636,10 +636,10 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
const int malloced = !backBuffer;
if (malloced) {
/* malloc a back buffer */
- backBuffer = _mesa_malloc(size);
+ backBuffer = malloc(size);
if (!backBuffer) {
_mesa_free_framebuffer_data(&buf->glframebuffer);
- _mesa_free(buf);
+ free(buf);
return NULL;
}
}
@@ -769,7 +769,7 @@ glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share )
if (!_mesa_initialize_context(&ctx->glcontext, &visual->glvisual,
share ? &share->glcontext : NULL,
&functions, (void *) ctx)) {
- _mesa_free(ctx);
+ free(ctx);
return NULL;
}
@@ -818,7 +818,7 @@ glFBDevDestroyContext( GLFBDevContextPtr context )
_mesa_make_current(NULL, NULL, NULL);
}
_mesa_free_context_data(&context->glcontext);
- _mesa_free(context);
+ free(context);
}
}
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index d94bf08a882..b78b101240e 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -1628,7 +1628,7 @@ fxDDGetString(GLcontext * ctx, GLenum name)
if (ctx->Extensions.String == NULL) {
GLubyte *ext = _mesa_make_extension_string(ctx);
if (ext != NULL) {
- ctx->Extensions.String = _mesa_malloc(strlen((char *)ext) + 256);
+ ctx->Extensions.String = malloc(strlen((char *)ext) + 256);
if (ctx->Extensions.String != NULL) {
strcpy((char *)ctx->Extensions.String, (char *)ext);
/* put any additional extension names here */
@@ -1641,7 +1641,7 @@ fxDDGetString(GLcontext * ctx, GLenum name)
strcat((char *)ctx->Extensions.String, " WGL_EXT_extensions_string WGL_ARB_extensions_string");
#endif
/* put any additional extension names here */
- _mesa_free(ext);
+ free(ext);
} else {
ctx->Extensions.String = ext;
}
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c
index a87a28ac3e0..b35874fffc3 100644
--- a/src/mesa/drivers/glide/fxddtex.c
+++ b/src/mesa/drivers/glide/fxddtex.c
@@ -1397,10 +1397,10 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level,
mml->width,
mml->height, 1);
dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width);
- texImage->Data = _mesa_malloc(texImage->CompressedSize);
+ texImage->Data = malloc(texImage->CompressedSize);
} else {
dstRowStride = mml->width * texelBytes;
- texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes);
+ texImage->Data = malloc(mml->width * mml->height * texelBytes);
}
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");
@@ -1654,7 +1654,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target,
texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat,
mml->width,
mml->height, 1);
- texImage->Data = _mesa_malloc(texImage->CompressedSize);
+ texImage->Data = malloc(texImage->CompressedSize);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D");
return;
diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c
index 9bf37967cd7..9bb352fcb82 100644
--- a/src/mesa/drivers/glide/fxsetup.c
+++ b/src/mesa/drivers/glide/fxsetup.c
@@ -107,14 +107,14 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj)
&(mml->wScale), &(mml->hScale));
_w *= mml->wScale;
_h *= mml->hScale;
- texImage->Data = _mesa_malloc(_w * _h * texelBytes);
+ texImage->Data = malloc(_w * _h * texelBytes);
_mesa_rescale_teximage2d(texelBytes,
mml->width,
_w * texelBytes, /* dst stride */
mml->width, mml->height, /* src */
_w, _h, /* dst */
texImage_Data /*src*/, texImage->Data /*dst*/ );
- _mesa_free(texImage_Data);
+ free(texImage_Data);
mml->width = _w;
mml->height = _h;
/* (!) ... and set mml->wScale = _w / texImage->Width */
diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c
index e4527abdeca..448029dacea 100644
--- a/src/mesa/drivers/glslcompiler/glslcompiler.c
+++ b/src/mesa/drivers/glslcompiler/glslcompiler.c
@@ -119,7 +119,7 @@ CreateContext(void)
0, 0, 0, 0, 1); /* accum */
buf = _mesa_create_framebuffer(vis);
- cc = _mesa_calloc(sizeof(*cc));
+ cc = calloc(1, sizeof(*cc));
if (!vis || !buf || !cc) {
if (vis)
_mesa_destroy_visual(vis);
@@ -143,7 +143,7 @@ CreateContext(void)
!_swsetup_CreateContext( ctx )) {
_mesa_destroy_visual(vis);
_mesa_free_context_data(ctx);
- _mesa_free(cc);
+ free(cc);
return GL_FALSE;
}
TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline;
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 1c469b15bf0..f9672d888e8 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -818,7 +818,7 @@ compute_row_addresses( OSMesaContext osmesa )
static void
osmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
{
- _mesa_free(rb);
+ free(rb);
}
@@ -1189,7 +1189,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
1 /* num samples */
);
if (!osmesa->gl_visual) {
- _mesa_free(osmesa);
+ free(osmesa);
return NULL;
}
@@ -1206,7 +1206,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
: (GLcontext *) NULL,
&functions, (void *) osmesa)) {
_mesa_destroy_visual( osmesa->gl_visual );
- _mesa_free(osmesa);
+ free(osmesa);
return NULL;
}
@@ -1221,7 +1221,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
if (!osmesa->gl_buffer) {
_mesa_destroy_visual( osmesa->gl_visual );
_mesa_free_context_data( &osmesa->mesa );
- _mesa_free(osmesa);
+ free(osmesa);
return NULL;
}
@@ -1260,7 +1260,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
!_swsetup_CreateContext( ctx )) {
_mesa_destroy_visual(osmesa->gl_visual);
_mesa_free_context_data(ctx);
- _mesa_free(osmesa);
+ free(osmesa);
return NULL;
}
@@ -1305,7 +1305,7 @@ OSMesaDestroyContext( OSMesaContext osmesa )
_mesa_reference_framebuffer( &osmesa->gl_buffer, NULL );
_mesa_free_context_data( &osmesa->mesa );
- _mesa_free( osmesa );
+ free( osmesa );
}
}
diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def
index d7d6cfa4e2a..baa592f1369 100644
--- a/src/mesa/drivers/windows/gdi/mesa.def
+++ b/src/mesa/drivers/windows/gdi/mesa.def
@@ -868,7 +868,6 @@ EXPORTS
_mesa_add_soft_renderbuffers
_mesa_add_renderbuffer
_mesa_bzero
- _mesa_calloc
_mesa_check_conditional_render
_mesa_choose_tex_format
_mesa_create_framebuffer
@@ -887,7 +886,6 @@ EXPORTS
_mesa_error
_mesa_finish_render_texture
_mesa_framebuffer_renderbuffer
- _mesa_free
_mesa_free_context_data
_mesa_free_texture_image_data
_mesa_generate_mipmap
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index b24b758cfb2..2fdcb387be7 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -1245,7 +1245,7 @@ static void read_rgba_pixels_16(const GLcontext *ctx,
static void
wmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
{
- _mesa_free(rb);
+ free(rb);
}
@@ -1474,7 +1474,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
1); /* num samples */
if (!visual) {
- _mesa_free(c);
+ free(c);
return NULL;
}
@@ -1512,7 +1512,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
!_tnl_CreateContext(ctx) ||
!_swsetup_CreateContext(ctx)) {
_mesa_free_context_data(ctx);
- _mesa_free(c);
+ free(c);
return NULL;
}
_swsetup_Wakeup(ctx);
@@ -1557,7 +1557,7 @@ void WMesaDestroyContext( WMesaContext pwc )
_swrast_DestroyContext(ctx);
_mesa_free_context_data(ctx);
- _mesa_free(pwc);
+ free(pwc);
}
diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def
index f6bd2aa68b8..6f33d170ffe 100644
--- a/src/mesa/drivers/windows/icd/mesa.def
+++ b/src/mesa/drivers/windows/icd/mesa.def
@@ -32,8 +32,6 @@ EXPORTS
_mesa_buffer_data
_mesa_buffer_map
_mesa_buffer_subdata
- _mesa_bzero
- _mesa_calloc
_mesa_choose_tex_format
_mesa_compressed_texture_size
_mesa_create_framebuffer
@@ -47,7 +45,6 @@ EXPORTS
_mesa_enable_1_5_extensions
_mesa_enable_sw_extensions
_mesa_error
- _mesa_free
_mesa_free_context_data
_mesa_get_current_context
_mesa_init_default_imports
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 291e90c822d..f097d93a710 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1381,7 +1381,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list )
return xmvis->vishandle;
#else
/* create a new vishandle - the cached one may be stale */
- xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo));
+ xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo));
if (xmvis->vishandle) {
memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo));
}
@@ -1438,7 +1438,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
xmvis = create_glx_visual( dpy, visinfo );
if (!xmvis) {
/* unusable visual */
- _mesa_free(glxCtx);
+ free(glxCtx);
return NULL;
}
}
@@ -1446,7 +1446,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo,
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
- _mesa_free(glxCtx);
+ free(glxCtx);
return NULL;
}
@@ -1671,7 +1671,7 @@ Fake_glXDestroyContext( Display *dpy, GLXContext ctx )
MakeCurrent_PrevReadBuffer = 0;
XMesaDestroyContext( glxCtx->xmesaContext );
XMesaGarbageCollect();
- _mesa_free(glxCtx);
+ free(glxCtx);
}
@@ -2108,7 +2108,7 @@ Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements )
visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements);
if (*nelements > 0) {
XMesaVisual *results;
- results = (XMesaVisual *) _mesa_malloc(*nelements * sizeof(XMesaVisual));
+ results = (XMesaVisual *) malloc(*nelements * sizeof(XMesaVisual));
if (!results) {
*nelements = 0;
return NULL;
@@ -2135,7 +2135,7 @@ Fake_glXChooseFBConfig( Display *dpy, int screen,
xmvis = choose_visual(dpy, screen, attribList, GL_TRUE);
if (xmvis) {
- GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual));
+ GLXFBConfig *config = (GLXFBConfig *) malloc(sizeof(XMesaVisual));
if (!config) {
*nitems = 0;
return NULL;
@@ -2160,7 +2160,7 @@ Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
return xmvis->vishandle;
#else
/* create a new vishandle - the cached one may be stale */
- xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo));
+ xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo));
if (xmvis->vishandle) {
memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo));
}
@@ -2469,7 +2469,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config,
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
- _mesa_free(glxCtx);
+ free(glxCtx);
return NULL;
}
@@ -2687,7 +2687,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
- _mesa_free(glxCtx);
+ free(glxCtx);
return NULL;
}
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 98ce6c5831a..ed945023cf3 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -253,7 +253,7 @@ bits_per_pixel( XMesaVisual xmv )
/* grab the bits/pixel value */
bitsPerPixel = img->bits_per_pixel;
/* free the XImage */
- _mesa_free( img->data );
+ free( img->data );
img->data = NULL;
XMesaDestroyImage( img );
return bitsPerPixel;
@@ -383,7 +383,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type,
*/
b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_FALSE);
if (!b->frontxrb) {
- _mesa_free(b);
+ free(b);
return NULL;
}
b->frontxrb->Parent = b;
@@ -399,7 +399,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type,
b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_TRUE);
if (!b->backxrb) {
/* XXX free front xrb too */
- _mesa_free(b);
+ free(b);
return NULL;
}
b->backxrb->Parent = b;
@@ -596,7 +596,7 @@ noFaultXAllocColor( int client,
|| prevCmapSize != cmapSize || !ctable) {
/* free previously cached color table */
if (ctable)
- _mesa_free(ctable);
+ free(ctable);
/* Get the color table from X */
ctable = (XMesaColor *) MALLOC(cmapSize * sizeof(XMesaColor));
assert(ctable);
@@ -652,8 +652,8 @@ noFaultXAllocColor( int client,
*alloced = 0;
}
#ifdef XFree86Server
- _mesa_free(ppixIn);
- _mesa_free(ctable);
+ free(ppixIn);
+ free(ctable);
#else
/* don't free table, save it for next time */
#endif
@@ -1366,14 +1366,14 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
v->display = display;
- /* Save a copy of the XVisualInfo struct because the user may X_mesa_free()
+ /* Save a copy of the XVisualInfo struct because the user may Xfree()
* the struct but we may need some of the information contained in it
* at a later time.
*/
#ifndef XFree86Server
v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo));
if(!v->visinfo) {
- _mesa_free(v);
+ free(v);
return NULL;
}
memcpy(v->visinfo, visinfo, sizeof(*visinfo));
@@ -1473,9 +1473,9 @@ PUBLIC
void XMesaDestroyVisual( XMesaVisual v )
{
#ifndef XFree86Server
- _mesa_free(v->visinfo);
+ free(v->visinfo);
#endif
- _mesa_free(v);
+ free(v);
}
@@ -1514,7 +1514,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual,
share_list ? &(share_list->mesa) : (GLcontext *) NULL,
&functions, (void *) c)) {
- _mesa_free(c);
+ free(c);
return NULL;
}
@@ -1564,7 +1564,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
!_tnl_CreateContext( mesaCtx ) ||
!_swsetup_CreateContext( mesaCtx )) {
_mesa_free_context_data(&c->mesa);
- _mesa_free(c);
+ free(c);
return NULL;
}
@@ -1598,7 +1598,7 @@ void XMesaDestroyContext( XMesaContext c )
_tnl_DestroyContext( mesaCtx );
_vbo_DestroyContext( mesaCtx );
_mesa_free_context_data( mesaCtx );
- _mesa_free( c );
+ free( c );
}
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index bf386292895..5ffe1104846 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -242,7 +242,7 @@ xmesa_delete_renderbuffer(struct gl_renderbuffer *rb)
* should probably get freed here, but that's currently done in
* XMesaDestroyBuffer().
*/
- _mesa_free(rb);
+ free(rb);
}
@@ -412,11 +412,11 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb)
}
if (b->rowimage) {
- _mesa_free( b->rowimage->data );
+ free( b->rowimage->data );
b->rowimage->data = NULL;
XMesaDestroyImage( b->rowimage );
}
_mesa_free_framebuffer_data(fb);
- _mesa_free(fb);
+ free(fb);
}