summaryrefslogtreecommitdiffstats
path: root/src/glsl/linker.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-01-21 14:32:31 -0800
committerKenneth Graunke <[email protected]>2011-01-31 10:17:09 -0800
commitd3073f58c17d8675a2ecdd5dfa83e5520c78e1a8 (patch)
tree31cdec04f53e61fb4b44d05d9b82795e591c71c2 /src/glsl/linker.cpp
parentdc55254f5b23e5ad7a07c974ce772f93b4c11cb0 (diff)
Convert everything from the talloc API to the ralloc API.
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r--src/glsl/linker.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 4332338df8e..3d1b8a2f703 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -172,9 +172,9 @@ linker_error_printf(gl_shader_program *prog, const char *fmt, ...)
{
va_list ap;
- prog->InfoLog = talloc_strdup_append(prog->InfoLog, "error: ");
+ ralloc_strcat(&prog->InfoLog, "error: ");
va_start(ap, fmt);
- prog->InfoLog = talloc_vasprintf_append(prog->InfoLog, fmt, ap);
+ ralloc_vasprintf_append(&prog->InfoLog, fmt, ap);
va_end(ap);
}
@@ -432,7 +432,7 @@ cross_validate_globals(struct gl_shader_program *prog,
* FINISHME: will fail.
*/
existing->constant_value =
- var->constant_value->clone(talloc_parent(existing), NULL);
+ var->constant_value->clone(ralloc_parent(existing), NULL);
}
if (existing->invariant != var->invariant) {
@@ -1015,7 +1015,7 @@ add_uniform(void *mem_ctx, exec_list *uniforms, struct hash_table *ht,
if (type->is_record()) {
for (unsigned int i = 0; i < type->length; i++) {
const glsl_type *field_type = type->fields.structure[i].type;
- char *field_name = talloc_asprintf(mem_ctx, "%s.%s", name,
+ char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name,
type->fields.structure[i].name);
add_uniform(mem_ctx, uniforms, ht, field_name, field_type,
@@ -1031,7 +1031,7 @@ add_uniform(void *mem_ctx, exec_list *uniforms, struct hash_table *ht,
/* Array of structures. */
if (array_elem_type->is_record()) {
for (unsigned int i = 0; i < type->length; i++) {
- char *elem_name = talloc_asprintf(mem_ctx, "%s[%d]", name, i);
+ char *elem_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i);
add_uniform(mem_ctx, uniforms, ht, elem_name, array_elem_type,
shader_type, next_shader_pos, total_uniforms);
}
@@ -1093,7 +1093,7 @@ assign_uniform_locations(struct gl_shader_program *prog)
unsigned total_uniforms = 0;
hash_table *ht = hash_table_ctor(32, hash_table_string_hash,
hash_table_string_compare);
- void *mem_ctx = talloc_new(NULL);
+ void *mem_ctx = ralloc_context(NULL);
for (unsigned i = 0; i < MESA_SHADER_TYPES; i++) {
if (prog->_LinkedShaders[i] == NULL)
@@ -1122,7 +1122,7 @@ assign_uniform_locations(struct gl_shader_program *prog)
}
}
- talloc_free(mem_ctx);
+ ralloc_free(mem_ctx);
gl_uniform_list *ul = (gl_uniform_list *)
calloc(1, sizeof(gl_uniform_list));
@@ -1490,16 +1490,16 @@ assign_varying_locations(struct gl_shader_program *prog,
void
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
{
- void *mem_ctx = talloc_init("temporary linker context");
+ void *mem_ctx = ralloc_context(NULL); // temporary linker context
prog->LinkStatus = false;
prog->Validated = false;
prog->_Used = false;
if (prog->InfoLog != NULL)
- talloc_free(prog->InfoLog);
+ ralloc_free(prog->InfoLog);
- prog->InfoLog = talloc_strdup(NULL, "");
+ prog->InfoLog = ralloc_strdup(NULL, "");
/* Separate the shaders into groups based on their type.
*/
@@ -1694,5 +1694,5 @@ done:
reparent_ir(prog->_LinkedShaders[i]->ir, prog->_LinkedShaders[i]->ir);
}
- talloc_free(mem_ctx);
+ ralloc_free(mem_ctx);
}