compiler/types: Use ralloc for the key in array_types
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23281>
This commit is contained in:
@@ -482,10 +482,6 @@ static void
|
|||||||
hash_free_type_function(struct hash_entry *entry)
|
hash_free_type_function(struct hash_entry *entry)
|
||||||
{
|
{
|
||||||
glsl_type *type = (glsl_type *) entry->data;
|
glsl_type *type = (glsl_type *) entry->data;
|
||||||
|
|
||||||
if (type->is_array())
|
|
||||||
free((void*)entry->key);
|
|
||||||
|
|
||||||
delete type;
|
delete type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1228,7 +1224,7 @@ glsl_type::get_array_instance(const glsl_type *element,
|
|||||||
const glsl_type *t = new glsl_type(element, array_size, explicit_stride);
|
const glsl_type *t = new glsl_type(element, array_size, explicit_stride);
|
||||||
|
|
||||||
entry = _mesa_hash_table_insert_pre_hashed(array_types, key_hash,
|
entry = _mesa_hash_table_insert_pre_hashed(array_types, key_hash,
|
||||||
strdup(key),
|
ralloc_strdup(t->mem_ctx, key),
|
||||||
(void *) t);
|
(void *) t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user