ra: Use the same context when realloc'ing arrays.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 21 Jan 2011 23:39:57 +0000 (15:39 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 21 Jan 2011 23:39:57 +0000 (15:39 -0800)
The original allocations use regs->regs as the context, so talloc will
happily ignore the context given here.  Change it to match to clarify
that it isn't changing.

src/mesa/program/register_allocate.c

index f984e2f1402f536015b23e3818841bd6f7126429..700e351841b04bfbf7bc5e8d5bb5235781f8d6bc 100644 (file)
@@ -120,7 +120,7 @@ ra_add_conflict_list(struct ra_regs *regs, unsigned int r1, unsigned int r2)
 
    if (reg1->conflict_list_size == reg1->num_conflicts) {
       reg1->conflict_list_size *= 2;
-      reg1->conflict_list = talloc_realloc(regs,
+      reg1->conflict_list = talloc_realloc(regs->regs,
                                           reg1->conflict_list,
                                           unsigned int,
                                           reg1->conflict_list_size);
@@ -143,7 +143,7 @@ ra_alloc_reg_class(struct ra_regs *regs)
 {
    struct ra_class *class;
 
-   regs->classes = talloc_realloc(regs, regs->classes,
+   regs->classes = talloc_realloc(regs->regs, regs->classes,
                                  struct ra_class *,
                                  regs->class_count + 1);