From: Kenneth Graunke Date: Sat, 19 Jun 2010 18:24:33 +0000 (-0700) Subject: Make shader a talloc context. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=32cf482215f698c46fd782104ca2e0560da5be17;p=mesa.git Make shader a talloc context. --- diff --git a/main.cpp b/main.cpp index 9301d5113f5..f6e5e95fcbe 100644 --- a/main.cpp +++ b/main.cpp @@ -29,6 +29,10 @@ #include #include +extern "C" { +#include +} + #include "ast.h" #include "glsl_parser_extras.h" #include "glsl_parser.h" @@ -186,8 +190,8 @@ main(int argc, char **argv) sizeof(struct glsl_shader *) * (whole_program.NumShaders + 1)); assert(whole_program.Shaders != NULL); - struct glsl_shader *shader = new glsl_shader; - memset(shader, 0, sizeof(*shader)); + /* talloc context should probably be whole_program */ + struct glsl_shader *shader = talloc_zero(NULL, glsl_shader); whole_program.Shaders[whole_program.NumShaders] = shader; whole_program.NumShaders++;