Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions

parent 6bf1ea89
......@@ -812,7 +812,7 @@ __eglGetDrawableInfo(__DRInativeDisplay * ndpy, int screen, __DRIid drawable,
return GL_FALSE;
}
cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t));
cliprect = (drm_clip_rect_t*) malloc(sizeof(drm_clip_rect_t));
cliprect->x1 = drawable->x;
cliprect->y1 = drawable->y;
cliprect->x2 = drawable->x + drawable->w;
......
......@@ -1018,7 +1018,7 @@ glXChooseVisual( Display *dpy, int screen, int *list )
xmvis = choose_visual(dpy, screen, list, GL_FALSE);
if (xmvis) {
/* 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));
}
......@@ -1055,7 +1055,7 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo,
xmvis = create_glx_visual( dpy, visinfo );
if (!xmvis) {
/* unusable visual */
_mesa_free(glxCtx);
free(glxCtx);
return NULL;
}
}
......@@ -1063,7 +1063,7 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo,
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
_mesa_free(glxCtx);
free(glxCtx);
return NULL;
}
......@@ -1336,7 +1336,7 @@ glXDestroyContext( Display *dpy, GLXContext ctx )
MakeCurrent_PrevReadBuffer = 0;
XMesaDestroyContext( glxCtx->xmesaContext );
XMesaGarbageCollect();
_mesa_free(glxCtx);
free(glxCtx);
}
......@@ -1755,7 +1755,7 @@ 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;
......@@ -1782,7 +1782,7 @@ 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;
......@@ -1807,7 +1807,7 @@ 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));
}
......@@ -2112,7 +2112,7 @@ glXCreateNewContext( Display *dpy, GLXFBConfig config,
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
_mesa_free(glxCtx);
free(glxCtx);
return NULL;
}
......@@ -2332,7 +2332,7 @@ glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_
glxCtx->xmesaContext = XMesaCreateContext(xmvis,
shareCtx ? shareCtx->xmesaContext : NULL);
if (!glxCtx->xmesaContext) {
_mesa_free(glxCtx);
free(glxCtx);
return NULL;
}
......
......@@ -175,7 +175,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;
XDestroyImage( img );
return bitsPerPixel;
......@@ -669,13 +669,13 @@ XMesaVisual XMesaCreateVisual( Display *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.
*/
v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo));
if (!v->visinfo) {
_mesa_free(v);
free(v);
return NULL;
}
memcpy(v->visinfo, visinfo, sizeof(*visinfo));
......@@ -743,8 +743,8 @@ XMesaVisual XMesaCreateVisual( Display *display,
PUBLIC
void XMesaDestroyVisual( XMesaVisual v )
{
_mesa_free(v->visinfo);
_mesa_free(v);
free(v->visinfo);
free(v);
}
......@@ -811,7 +811,7 @@ fail:
else if (pipe)
pipe->destroy(pipe);
_mesa_free(c);
free(c);
return NULL;
}
......@@ -828,7 +828,7 @@ void XMesaDestroyContext( XMesaContext c )
screen->destroy(screen);
*/
_mesa_free(c);
free(c);
}
......
......@@ -31,39 +31,13 @@
* \author Ian Romanick <idr@us.ibm.com>
*/
#if defined(IN_MINI_GLX)
#include <GL/gl.h>
#else
#if defined(HAVE_DIX_CONFIG_H)
# include <dix-config.h>
#endif
#include <X11/X.h>
#include <GL/glx.h>
#include "GL/glxint.h"
#endif
/* Memory macros */
#if defined(IN_MINI_GLX)
# include <stdlib.h>
# include <string.h>
# define _mesa_malloc(b) malloc(b)
# define _mesa_free(m) free(m)
#else
# ifdef XFree86Server
# include <os.h>
# include <string.h>
# define _mesa_malloc(b) xalloc(b)
# define _mesa_free(m) xfree(m)
# else
# include <X11/Xlibint.h>
# define _mesa_malloc(b) Xmalloc(b)
# define _mesa_free(m) Xfree(m)
# endif /* XFree86Server */
#endif /* !defined(IN_MINI_GLX) */
#include <stdlib.h>
#include <string.h>
#include "glcontextmodes.h"
#if !defined(IN_MINI_GLX)
#define NUM_VISUAL_TYPES 6
/**
......@@ -352,7 +326,6 @@ _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute,
return GLX_BAD_ATTRIBUTE;
}
}
#endif /* !defined(IN_MINI_GLX) */
/**
......@@ -392,7 +365,7 @@ _gl_context_modes_create(unsigned count, size_t minimum_size)
next = &base;
for (i = 0; i < count; i++) {
*next = (__GLcontextModes *) _mesa_malloc(size);
*next = (__GLcontextModes *) malloc(size);
if (*next == NULL) {
_gl_context_modes_destroy(base);
base = NULL;
......@@ -438,7 +411,7 @@ _gl_context_modes_destroy(__GLcontextModes * modes)
while (modes != NULL) {
__GLcontextModes *const next = modes->next;
_mesa_free(modes);
free(modes);
modes = next;
}
}
......
......@@ -32,14 +32,12 @@
#include "GL/internal/glcore.h"
#if !defined(IN_MINI_GLX)
extern GLint _gl_convert_from_x_visual_type(int visualType);
extern GLint _gl_convert_to_x_visual_type(int visualType);
extern void _gl_copy_visual_to_context_mode(__GLcontextModes * mode,
const __GLXvisualConfig * config);
extern int _gl_get_context_mode_data(const __GLcontextModes * mode,
int attribute, int *value_return);
#endif /* !defined(IN_MINI_GLX) */
extern __GLcontextModes *_gl_context_modes_create(unsigned count,
size_t minimum_size);
......
......@@ -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);
}
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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);
}
}
}
......
......@@ -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;
}
......
......@@ -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;
...