return;
}
- free(program->String);
+ ralloc_free(program->String);
/* Copy the relevant contents of the arb_program struct into the
* fragment_program struct.
program->info.fs.uses_discard = state.fragment.UsesKill;
- free(program->arb.Instructions);
+ ralloc_free(program->arb.Instructions);
program->arb.Instructions = prog.arb.Instructions;
if (program->Parameters)
unsigned num_instructions = v.instructions.length();
- mesa_instructions =
- (struct prog_instruction *)calloc(num_instructions,
- sizeof(*mesa_instructions));
+ mesa_instructions = rzalloc_array(prog, struct prog_instruction,
+ num_instructions);
mesa_instruction_annotation = ralloc_array(v.mem_ctx, ir_instruction *,
num_instructions);
return prog;
fail_exit:
- free(mesa_instructions);
+ ralloc_free(mesa_instructions);
_mesa_reference_program(ctx, &shader->Program, NULL);
return NULL;
}