diff options
author | Carl Worth <cworth@cworth.org> | 2010-06-23 18:11:51 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-06-23 18:59:35 -0700 |
commit | 1660a2954797e056caba319c5d6c70b0d4be22fe (patch) | |
tree | 172af2dd8effb58c89828b917cae850058312edd /s_expression.h | |
parent | 8f52c9b5fcbc73ed12b23253caa44c28fd4452e2 (diff) |
exec_node: Add new talloc-based new()
And fix all callers to use the tallbac-based new for exec_node
construction. We make ready use of talloc_parent in order to get
valid, (and appropriate) talloc owners for everything we construct
without having to add new 'ctx' parameters up and down all the call
trees.
This closes the majority of the memory leaks in the
glsl-orangebook-ch06-bump.frag test:
total heap usage: 55,623 allocs, 42,672 frees
(was 14,533 frees)
Now 76.7% leak-free. Woo-hoo!
Diffstat (limited to 's_expression.h')
-rw-r--r-- | s_expression.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/s_expression.h b/s_expression.h index 8a4eda28da..1a0c03c218 100644 --- a/s_expression.h +++ b/s_expression.h @@ -49,8 +49,10 @@ public: /** * Read an S-Expression from the given string. * Advances the supplied pointer to just after the expression read. + * + * Any allocation will be performed with 'ctx' as the talloc owner. */ - static s_expression *read_expression(const char *&src); + static s_expression *read_expression(void *ctx, const char *&src); /** * Print out an S-Expression. Useful for debugging. |