diff options
author | Brian Paul <[email protected]> | 2009-02-12 10:08:25 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-02-12 10:11:55 -0700 |
commit | 1a2f4dd8768703fbc1b2a0d5be342345644805b4 (patch) | |
tree | 4b3015001998370edd8df9dcd3c7eaed6f2f7f42 /src/mesa/state_tracker | |
parent | 19dff5efc1e348d037b1b3cdfb9ac91020ecde4d (diff) |
mesa: consistantly use mesa memory-functions in gallium state tracker
Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc.
Still using CALLOC_STRUCT() at this point.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_accum.c | 20 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_clear.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 12 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_program.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_queryobj.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_rasterpos.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 6 |
14 files changed, 37 insertions, 37 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index fc8587f4598..f79092291b0 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -69,7 +69,7 @@ void st_init_atoms( struct st_context *st ) { GLuint i; - st->atoms = malloc(sizeof(atoms)); + st->atoms = _mesa_malloc(sizeof(atoms)); st->nr_atoms = sizeof(atoms)/sizeof(*atoms); memcpy(st->atoms, atoms, sizeof(atoms)); @@ -92,7 +92,7 @@ void st_init_atoms( struct st_context *st ) void st_destroy_atoms( struct st_context *st ) { if (st->atoms) { - free(st->atoms); + _mesa_free(st->atoms); st->atoms = NULL; } } diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index cbd414e2d3b..5653933e123 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -298,7 +298,7 @@ st_free_translated_vertex_programs(struct st_context *st, while (xvp) { next = xvp->next; - free(xvp); + _mesa_free(xvp); xvp = next; } } @@ -313,7 +313,7 @@ get_passthrough_fs(struct st_context *st) st->passthrough_fs = util_make_fragment_passthrough_shader(st->pipe, &shader); #if 0 /* We actually need to keep the tokens around at this time */ - free((void *) shader.tokens); + _mesa_free((void *) shader.tokens); #endif } diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index a4e72b48ed4..2fc37343bdf 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -206,8 +206,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value, color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); - colorBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - accBuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + colorBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + accBuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, colorBuf); acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf); @@ -218,8 +218,8 @@ accum_accum(struct pipe_context *pipe, GLfloat value, acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, accBuf); - free(colorBuf); - free(accBuf); + _mesa_free(colorBuf); + _mesa_free(accBuf); pipe_surface_reference(&acc_surf, NULL); pipe_surface_reference(&color_surf, NULL); } @@ -242,7 +242,7 @@ accum_load(struct pipe_context *pipe, GLfloat value, color_surf = screen->get_tex_surface(screen, color_strb->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); - buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, buf); @@ -252,7 +252,7 @@ accum_load(struct pipe_context *pipe, GLfloat value, acc_put_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, buf); - free(buf); + _mesa_free(buf); pipe_surface_reference(&acc_surf, NULL); pipe_surface_reference(&color_surf, NULL); } @@ -271,7 +271,7 @@ accum_return(GLcontext *ctx, GLfloat value, GLfloat *abuf, *cbuf = NULL; GLint i, ch; - abuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + abuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); acc_surf = screen->get_tex_surface(screen, acc_strb->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); @@ -283,7 +283,7 @@ accum_return(GLcontext *ctx, GLfloat value, acc_get_tile_rgba(pipe, acc_surf, xpos, ypos, width, height, abuf); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) { - cbuf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + cbuf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_surf, xpos, ypos, width, height, cbuf); } @@ -301,9 +301,9 @@ accum_return(GLcontext *ctx, GLfloat value, pipe_put_tile_rgba(color_surf, xpos, ypos, width, height, abuf); - free(abuf); + _mesa_free(abuf); if (cbuf) - free(cbuf); + _mesa_free(cbuf); pipe_surface_reference(&acc_surf, NULL); pipe_surface_reference(&color_surf, NULL); } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index f14e562400b..fff348de59e 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -827,7 +827,7 @@ st_destroy_bitmap(struct st_context *st) if (st->bitmap.cache) { pipe_texture_release(&st->bitmap.cache->texture); - FREE(st->bitmap.cache); + _mesa_free(st->bitmap.cache); st->bitmap.cache = NULL; } } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 07fa2afce05..e601ec46f8f 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -80,7 +80,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj) if (st_obj->buffer) pipe_buffer_reference(pipe->screen, &st_obj->buffer, NULL); - free(st_obj); + _mesa_free(st_obj); } diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 668c3f9ebf4..0eddda23a7a 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -98,12 +98,12 @@ st_destroy_clear(struct st_context *st) struct pipe_context *pipe = st->pipe; if (st->clear.vert_shader.tokens) { - FREE((void *) st->clear.vert_shader.tokens); + _mesa_free((void *) st->clear.vert_shader.tokens); st->clear.vert_shader.tokens = NULL; } if (st->clear.frag_shader.tokens) { - FREE((void *) st->clear.frag_shader.tokens); + _mesa_free((void *) st->clear.frag_shader.tokens); st->clear.frag_shader.tokens = NULL; } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 32bf21411da..cb4a01c22b6 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -896,7 +896,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, ubyte *buffer; int i; - buffer = malloc(width * height * sizeof(ubyte)); + buffer = _mesa_malloc(width * height * sizeof(ubyte)); if (!buffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); return; @@ -950,7 +950,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } - free(buffer); + _mesa_free(buffer); /* unmap the stencil buffer */ screen->surface_unmap(screen, psDraw); @@ -1056,19 +1056,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (type == GL_COLOR) { /* alternate path using get/put_tile() */ - GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(psRead, srcx, srcy, width, height, buf); pipe_put_tile_rgba(psTex, 0, 0, width, height, buf); - free(buf); + _mesa_free(buf); } else { /* GL_DEPTH */ - GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); + GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); pipe_get_tile_z(psRead, srcx, srcy, width, height, buf); pipe_put_tile_z(psTex, 0, 0, width, height, buf); - free(buf); + _mesa_free(buf); } pipe_surface_reference(&psRead, NULL); } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 9af648b8d0f..fd85a7a3050 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -194,7 +194,7 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb) ASSERT(strb); pipe_surface_reference(&strb->surface, NULL); pipe_texture_reference(&strb->texture, NULL); - free(strb); + _mesa_free(strb); } diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index ea0fa20012e..44f47865f80 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -152,7 +152,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stvp->state.tokens) { - FREE((void *) stvp->state.tokens); + _mesa_free((void *) stvp->state.tokens); stvp->state.tokens = NULL; } } @@ -167,7 +167,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stfp->state.tokens) { - FREE((void *) stfp->state.tokens); + _mesa_free((void *) stfp->state.tokens); stfp->state.tokens = NULL; } @@ -214,7 +214,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stfp->state.tokens) { - FREE((void *) stfp->state.tokens); + _mesa_free((void *) stfp->state.tokens); stfp->state.tokens = NULL; } @@ -242,7 +242,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stvp->state.tokens) { - FREE((void *) stvp->state.tokens); + _mesa_free((void *) stvp->state.tokens); stvp->state.tokens = NULL; } diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index 21c2c7dd9ff..bd2716a45f5 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -87,7 +87,7 @@ st_DeleteQuery(GLcontext *ctx, struct gl_query_object *q) stq->pq = NULL; } - FREE(stq); + _mesa_free(stq); } diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 8867ca5652e..f4057778bda 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -102,7 +102,7 @@ rastpos_line( struct draw_stage *stage, struct prim_header *prim ) static void rastpos_destroy(struct draw_stage *stage) { - free(stage); + _mesa_free(stage); } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index e584a6ceeac..34f76d44625 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -217,7 +217,7 @@ static void st_destroy_context_priv( struct st_context *st ) st->default_texture = NULL; } - free( st ); + _mesa_free( st ); } @@ -245,7 +245,7 @@ void st_destroy_context( struct st_context *st ) pipe->destroy( pipe ); - free(ctx); + _mesa_free(ctx); } diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index ae71d586c2f..b52e4886128 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -223,7 +223,7 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count, if (!stobj) return NULL; - vec = (unsigned *) calloc(sizeof(unsigned), (count + 31) / 32); + vec = (unsigned *) _mesa_calloc(sizeof(unsigned) * ((count + 31) / 32)); if (!vec) return NULL; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 442eeed1470..d2535b6a2fa 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -61,9 +61,9 @@ static INLINE void * mem_dup(const void *src, uint size) { - void *dup = MALLOC(size); + void *dup = _mesa_malloc(size); if (dup) - memcpy(dup, src, size); + _mesa_memcpy(dup, src, size); return dup; } @@ -307,7 +307,7 @@ st_translate_vertex_program(struct st_context *st, /* free old shader state, if any */ if (stvp->state.tokens) { - FREE((void *) stvp->state.tokens); + _mesa_free((void *) stvp->state.tokens); stvp->state.tokens = NULL; } if (stvp->driver_shader) { |