summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-06-18 17:52:59 -0700
committerCarl Worth <cworth@cworth.org>2010-06-23 19:00:42 -0700
commit12c411504ca86341f8b96c349c15413ee198cc71 (patch)
treeb6b00d8e7c8789b34d1e0f5686959dc95571b93f /ast_to_hir.cpp
parentdc5811fd0c7600b165ddd4e04a0ccae69bb19ec8 (diff)
Close memory leaks in glsl_type (constructor and get_array_instance)
Add a talloc ctx to both get_array_instance and the glsl_type constructor in order to be able to call talloc_size instead of malloc. This fix now makes glsl-orangebook-ch06-bump.frag 99.99% leak free: total heap usage: 55,623 allocs, 55,615 Only 8 missing frees now.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r--ast_to_hir.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index eafc9e8114..38e344f0d2 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -506,7 +506,8 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
var->max_array_access);
}
- var->type = glsl_type::get_array_instance(lhs->type->element_type(),
+ var->type = glsl_type::get_array_instance(state,
+ lhs->type->element_type(),
rhs->type->array_size());
}
}
@@ -1409,7 +1410,7 @@ process_array_type(const glsl_type *base, ast_node *array_size,
}
}
- return glsl_type::get_array_instance(base, length);
+ return glsl_type::get_array_instance(state, base, length);
}