summaryrefslogtreecommitdiff
path: root/glsl_types.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'glsl_types.cpp')
-rw-r--r--glsl_types.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/glsl_types.cpp b/glsl_types.cpp
index 7dcb4a4caf..d1b9dc6412 100644
--- a/glsl_types.cpp
+++ b/glsl_types.cpp
@@ -574,7 +574,7 @@ _mesa_glsl_initialize_constructors(exec_list *instructions,
}
-glsl_type::glsl_type(const glsl_type *array, unsigned length) :
+glsl_type::glsl_type(void *ctx, const glsl_type *array, unsigned length) :
base_type(GLSL_TYPE_ARRAY),
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
sampler_type(0),
@@ -588,7 +588,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
* NUL.
*/
const unsigned name_length = strlen(array->name) + 10 + 3;
- char *const n = (char *) malloc(name_length);
+ char *const n = (char *) talloc_size(ctx, name_length);
if (length == 0)
snprintf(n, name_length, "%s[]", array->name);
@@ -691,9 +691,10 @@ glsl_type::array_key_hash(const void *a)
const glsl_type *
-glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
+glsl_type::get_array_instance(void *ctx, const glsl_type *base,
+ unsigned array_size)
{
- const glsl_type key(base, array_size);
+ const glsl_type key(ctx, base, array_size);
if (array_types == NULL) {
array_types = hash_table_ctor(64, array_key_hash, array_key_compare);
@@ -701,7 +702,7 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size)
const glsl_type *t = (glsl_type *) hash_table_find(array_types, & key);
if (t == NULL) {
- t = new glsl_type(base, array_size);
+ t = new glsl_type(ctx, base, array_size);
hash_table_insert(array_types, (void *) t, t);
}