diff options
author | Marek Olšák <[email protected]> | 2016-10-07 00:34:26 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-10-31 11:53:38 +0100 |
commit | 52d2b28f7f107fbaff023533a15058055fa73bf0 (patch) | |
tree | b6f1de58134f1d10fc9dd766b81945021b53513a /src/compiler/nir/nir.c | |
parent | 9454f7c0ef55a9357473e451f0f59432c9438f01 (diff) |
ralloc: use rzalloc where it's necessary
No change in behavior. ralloc_size is equivalent to rzalloc_size.
That will change though.
Calls not switched to rzalloc_size:
- ralloc_vasprintf
- glsl_type::name allocation (it's filled with snprintf)
- C++ classes where valgrind didn't show uninitialized values
I switched most of non-glsl stuff to rzalloc without checking whether
it's really needed.
Reviewed-by: Edward O'Callaghan <[email protected]>
Tested-by: Edmondo Tommasina <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.c')
-rw-r--r-- | src/compiler/nir/nir.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 31f0bcb8d81..cfb032c68b9 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -448,9 +448,10 @@ nir_alu_instr * nir_alu_instr_create(nir_shader *shader, nir_op op) { unsigned num_srcs = nir_op_infos[op].num_inputs; + /* TODO: don't use rzalloc */ nir_alu_instr *instr = - ralloc_size(shader, - sizeof(nir_alu_instr) + num_srcs * sizeof(nir_alu_src)); + rzalloc_size(shader, + sizeof(nir_alu_instr) + num_srcs * sizeof(nir_alu_src)); instr_init(&instr->instr, nir_instr_type_alu); instr->op = op; @@ -486,8 +487,9 @@ nir_intrinsic_instr * nir_intrinsic_instr_create(nir_shader *shader, nir_intrinsic_op op) { unsigned num_srcs = nir_intrinsic_infos[op].num_srcs; + /* TODO: don't use rzalloc */ nir_intrinsic_instr *instr = - ralloc_size(shader, + rzalloc_size(shader, sizeof(nir_intrinsic_instr) + num_srcs * sizeof(nir_src)); instr_init(&instr->instr, nir_instr_type_intrinsic); |