From: Eric Anholt Date: Fri, 2 Oct 2009 17:53:56 +0000 (-0700) Subject: i965: Use a little stack space to avoid a malloc in wm_get_binding_table. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4182b58169c1c37833c590d00d0a6a52b2b55326;p=mesa.git i965: Use a little stack space to avoid a malloc in wm_get_binding_table. --- diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 4f651170c60..9c28a22a298 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -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;