nv04: use FREE/MALLOC like a good gallium boy should.
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>
Tue, 8 Jul 2008 18:06:57 +0000 (20:06 +0200)
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>
Tue, 8 Jul 2008 18:06:57 +0000 (20:06 +0200)
src/gallium/drivers/nv04/nv04_miptree.c
src/gallium/drivers/nv04/nv04_prim_vbuf.c
src/gallium/drivers/nv04/nv04_state.c

index ab2d2386bee385254db503405f6d1c4e5f0bf536..97f679731ea49955767fa014601c4c754fd30329 100644 (file)
@@ -62,7 +62,7 @@ nv04_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
        mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
                                           mt->total_size);
        if (!mt->buffer) {
-               free(mt);
+               FREE(mt);
                return NULL;
        }
        
@@ -83,9 +83,9 @@ nv04_miptree_release(struct pipe_screen *screen, struct pipe_texture **pt)
                pipe_buffer_reference(ws, &nv04mt->buffer, NULL);
                for (l = 0; l <= mt->last_level; l++) {
                        if (nv04mt->level[l].image_offset)
-                               free(nv04mt->level[l].image_offset);
+                               FREE(nv04mt->level[l].image_offset);
                }
-               free(nv04mt);
+               FREE(nv04mt);
        }
 }
 
index 80a4dbc311ca4c5b1ea198f87b6124cce8716089..d3963d1f59d196bb97e0568633a7d8bcc0e5d579 100644 (file)
@@ -57,7 +57,7 @@ nv04_vbuf_render_allocate_vertices( struct vbuf_render *render,
 {
        struct nv04_vbuf_render *nv04_render = nv04_vbuf_render(render);
 
-       nv04_render->buffer = (unsigned char*) malloc(VERTEX_BUFFER_SIZE);
+       nv04_render->buffer = (unsigned char*) MALLOC(VERTEX_BUFFER_SIZE);
        assert(!nv04_render->buffer);
 
        return nv04_render->buffer;
index 39d7e8b42d0c7a284e6878c3b4a4a88ffa8a1589..d618465a2018a9198aa59d632a47c7fc59f4e3d3 100644 (file)
@@ -14,7 +14,7 @@ nv04_blend_state_create(struct pipe_context *pipe,
 {
        struct nv04_blend_state *cb;
 
-       cb = malloc(sizeof(struct nv04_blend_state));
+       cb = MALLOC(sizeof(struct nv04_blend_state));
 
        cb->b_enable = cso->blend_enable ? 1 : 0;
        cb->b_src = ((nvgl_blend_func(cso->alpha_src_factor)<<16) |
@@ -81,7 +81,7 @@ nv04_sampler_state_create(struct pipe_context *pipe,
        struct nv04_sampler_state *ss;
        uint32_t filter = 0;
 
-       ss = malloc(sizeof(struct nv04_sampler_state));
+       ss = MALLOC(sizeof(struct nv04_sampler_state));
 
        ss->format = ((wrap_mode(cso->wrap_s) << NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSU_SHIFT) |
                    (wrap_mode(cso->wrap_t) << NV04_DX5_TEXTURED_TRIANGLE_FORMAT_ADDRESSV_SHIFT));
@@ -178,7 +178,7 @@ nv04_rasterizer_state_create(struct pipe_context *pipe,
         *      scissor
         *      points/lines (no hw support, emulated with tris in gallium)
         */
-       rs = malloc(sizeof(struct nv04_rasterizer_state));
+       rs = MALLOC(sizeof(struct nv04_rasterizer_state));
 
        rs->blend = cso->flatshade ? NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_FLAT : NV04_DX5_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_GOURAUD;
 
@@ -225,7 +225,7 @@ nv04_depth_stencil_alpha_state_create(struct pipe_context *pipe,
 {
        struct nv04_depth_stencil_alpha_state *hw;
 
-       hw = malloc(sizeof(struct nv04_depth_stencil_alpha_state));
+       hw = MALLOC(sizeof(struct nv04_depth_stencil_alpha_state));
 
        hw->control = float_to_ubyte(cso->alpha.ref);
        hw->control |= ( nv04_compare_func(cso->alpha.func) << NV04_DX5_TEXTURED_TRIANGLE_CONTROL_ALPHA_FUNC_SHIFT );