i965: Use a little stack space to avoid a malloc in wm_get_binding_table.
authorEric Anholt <eric@anholt.net>
Fri, 2 Oct 2009 17:53:56 +0000 (10:53 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 2 Oct 2009 18:42:19 +0000 (11:42 -0700)
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index 4f65117..9c28a22 100644 (file)
@@ -660,7 +660,7 @@ brw_wm_get_binding_table(struct brw_context *brw)
 
    if (bind_bo == NULL) {
       GLuint data_size = brw->wm.nr_surfaces * sizeof(GLuint);
-      uint32_t *data = malloc(data_size);
+      uint32_t data[BRW_WM_MAX_SURF];
       int i;
 
       for (i = 0; i < brw->wm.nr_surfaces; i++)
@@ -685,8 +685,6 @@ brw_wm_get_binding_table(struct brw_context *brw)
                              brw->wm.surf_bo[i]);
         }
       }
-
-      free(data);
    }
 
    return bind_bo;