diff options
author | Carl Worth <cworth@cworth.org> | 2010-06-23 19:04:45 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-06-23 19:04:45 -0700 |
commit | b3bd77da56ce8aa225ee91565e4d1e640685728c (patch) | |
tree | 2cb3bacc7f8d4b8df6c8b38ae5934ac9bd5f1c16 /glsl_types.cpp | |
parent | 12c411504ca86341f8b96c349c15413ee198cc71 (diff) |
glsl_type: Add a talloc-based new
And hook it up at the two sites it's called.
Note that with this change we still don't use glsl_type* objects as
talloc contexts, (see things like get_array_instance that accept both
a talloc 'ctx' as well as a glsl_type*). The reason for this is that
the code is still using many instance of glsl_type objects not created
with new.
This closes 3 leaks in the glsl-orangebook-ch06-bump.frag test:
total heap usage: 55,623 allocs, 55,618
Leaving only 5 leaks to go.
Diffstat (limited to 'glsl_types.cpp')
-rw-r--r-- | glsl_types.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glsl_types.cpp b/glsl_types.cpp index d1b9dc6412..bef267fa6b 100644 --- a/glsl_types.cpp +++ b/glsl_types.cpp @@ -702,7 +702,7 @@ glsl_type::get_array_instance(void *ctx, const glsl_type *base, const glsl_type *t = (glsl_type *) hash_table_find(array_types, & key); if (t == NULL) { - t = new glsl_type(ctx, base, array_size); + t = new(ctx) glsl_type(ctx, base, array_size); hash_table_insert(array_types, (void *) t, t); } |