Re: Memory Leaks

2006-11-22 Thread Hans Aberg
On 22 Nov 2006, at 19:31, Paulo J. Matos wrote: > Which means that since I'm using a C generated parser I should use > destructor. But destructor will be called after each successful action > or after each failed parsing (to which an action never gets called but > the given value is actuall

Re: Memory Leaks

2006-11-21 Thread Hans Aberg
On 21 Nov 2006, at 14:00, Paulo J. Matos wrote: The C++ parser uses for parser stack a class like std::vector or std::deque, which invokes the class destructors when the stack is unwound. So if the classes of the objects on the parser stack are properly written, no special cleanup is needed.

Re: Memory Leaks

2006-11-18 Thread Hans Aberg
On 18 Nov 2006, at 17:39, Paulo J. Matos wrote: There is now %destructor to clean up C-code leaks during error recovery; otherwise, do it by hand in the actions. What do you mean by error recovery? If the parsing fails? Right. I still cannot understand when %destructor code is called. Th

Re: Memory Leaks

2006-11-18 Thread Paulo J. Matos
On 11/13/06, Hans Aberg <[EMAIL PROTECTED]> wrote: There is now %destructor to clean up C-code leaks during error recovery; otherwise, do it by hand in the actions. What do you mean by error recovery? If the parsing fails? I still cannot understand when %destructor code is called. I think th

Re: Memory Leaks

2006-11-13 Thread Hans Aberg
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 sem

Re: Memory Leaks

2006-11-13 Thread Sean Walton
Paulo J. Matos wrote: Hi all, 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

Re: memory leaks

2005-06-07 Thread Laurence Finston
On Tue, 7 Jun 2005, hz kto wrote: > > I am using C++ with bison 1.25, so it does not have %destructor. I cannot > rely on > garbage collecting, so I have to free everything myself. > Also I do not have common base class for all parse tree nodes (so I can't have > a storage for all parse tree node

Re: memory leaks

2005-06-06 Thread hz kto
After looking through the mailing archives I have had few things cleared. I am using C++ with bison 1.25, so it does not have %destructor. I cannot rely on garbage collecting, so I have to free everything myself. Also I do not have common base class for all parse tree nodes (so I can't have a st