From b972744c78e45928876ea781b9eeef09b3baf083 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Jan 2012 12:51:34 -0800 Subject: mesa: Make the register allocator allocation take a ralloc context. This fixes a memory leak on i965 context destruction. NOTE: This is a candidate for the 8.0 branch. --- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 2 +- src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp index 3f875cc63d9..d4dd1240b70 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp @@ -88,7 +88,7 @@ brw_alloc_reg_set_for_classes(struct brw_context *brw, ralloc_free(brw->wm.ra_reg_to_grf); brw->wm.ra_reg_to_grf = ralloc_array(brw, uint8_t, ra_reg_count); ralloc_free(brw->wm.regs); - brw->wm.regs = ra_alloc_reg_set(ra_reg_count); + brw->wm.regs = ra_alloc_reg_set(brw, ra_reg_count); ralloc_free(brw->wm.classes); brw->wm.classes = ralloc_array(brw, int, class_count + 1); diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp index 1ace91fafef..2efe235bff9 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp @@ -108,7 +108,7 @@ brw_alloc_reg_set_for_classes(struct brw_context *brw, ralloc_free(brw->vs.ra_reg_to_grf); brw->vs.ra_reg_to_grf = ralloc_array(brw, uint8_t, ra_reg_count); ralloc_free(brw->vs.regs); - brw->vs.regs = ra_alloc_reg_set(ra_reg_count); + brw->vs.regs = ra_alloc_reg_set(brw, ra_reg_count); ralloc_free(brw->vs.classes); brw->vs.classes = ralloc_array(brw, int, class_count + 1); -- cgit v1.2.3