summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.h
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2013-09-11 20:07:53 -0700
committerFrancisco Jerez <[email protected]>2013-10-01 17:30:51 -0700
commit43bf36b080192f7ad5727ed96e86f0a49390d9dc (patch)
treee0edb9f48c2c437f1343864c9349b25d4d4012d1 /src/glsl/glsl_parser_extras.h
parent0e72db9f9729b8fe62213452751fed1cd337a7bc (diff)
glsl: Initialize all member variables of _mesa_glsl_parse_state on construction.
The _mesa_glsl_parse_state object relies on the memory allocator zeroing out its contents before it's initialized, which is quite an unusual practice in the C++ world because it ties objects to some specific allocation scheme, and gives unpredictable results when an object is created with a different allocator -- Stack allocation, array allocation, or aggregation inside a different object are some of the useful possibilities that come to my mind. Initialize all fields from the constructor and stop using the zeroing allocator. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.h')
-rw-r--r--src/glsl/glsl_parser_extras.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index cef4436f672..d557f8ba69d 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -73,7 +73,7 @@ struct _mesa_glsl_parse_state {
_mesa_glsl_parse_state(struct gl_context *_ctx, GLenum target,
void *mem_ctx);
- DECLARE_RZALLOC_CXX_OPERATORS(_mesa_glsl_parse_state);
+ DECLARE_RALLOC_CXX_OPERATORS(_mesa_glsl_parse_state);
/**
* Generate a string representing the GLSL version currently being compiled