summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2009-10-11 14:24:52 +0200
committerMarek Olšák <[email protected]>2010-04-19 00:34:02 +0200
commit65fd6fb2044521511b867c76e270f285d0b15f06 (patch)
tree75f3782eff98e272e6b0a8868c2a3cb59afeb1bb /src/mesa/drivers
parent0321f9c6f13a7571376e5eb9ce6c110061ed09fd (diff)
r300/compiler: Use memory_pool_array_reserve in deadcode elimination
Signed-off-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
index f3734852cc6..e3c2c83c0cf 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c
@@ -80,19 +80,8 @@ static void or_updatemasks(
static void push_branch(struct deadcode_state * s)
{
- if (s->BranchStackSize >= s->BranchStackReserved) {
- unsigned int new_reserve = 2 * s->BranchStackReserved;
- struct branchinfo * new_stack;
-
- if (!new_reserve)
- new_reserve = 4;
-
- new_stack = memory_pool_malloc(&s->C->Pool, new_reserve * sizeof(struct branchinfo));
- memcpy(new_stack, s->BranchStack, s->BranchStackSize * sizeof(struct branchinfo));
-
- s->BranchStack = new_stack;
- s->BranchStackReserved = new_reserve;
- }
+ memory_pool_array_reserve(&s->C->Pool, struct branchinfo, s->BranchStack,
+ s->BranchStackSize, s->BranchStackReserved, 1);
struct branchinfo * branch = &s->BranchStack[s->BranchStackSize++];
branch->HaveElse = 0;