On 13 Nov 2006, at 18:17, Sean Walton wrote:

I've generated a parser with bison and I tried running valgrind on it.
The wierd thing is... there's a huge bunch of memory leaks reported.
:-(

Is this known? Is this a bison leak or a valgrind bug?

Regards,

If you are using malloc() in your semantic actions, you will witness memory leaks unless you are *very* careful to release them. I was given this warning as I have gone in and started modifying someone else's work.

There is now %destructor to clean up C-code leaks during error recovery; otherwise, do it by hand in the actions. I think the developers have worked hard to plug the Bison generated parsers. I don't use C, but C++, in which case one can use language features to do the cleanup.

  Hans Aberg




_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to