|Memory leaks upon error recovery in Yacc email@example.com (David Pereira) (2000-11-18)|
|Re: Memory leaks upon error recovery in Yacc firstname.lastname@example.org (Timur Safin) (2000-12-01)|
|Re: Memory leaks upon error recovery in Yacc email@example.com (2000-12-18)|
|Re: Memory leaks upon error recovery in Yacc firstname.lastname@example.org (2000-12-18)|
|From:||"Timur Safin" <email@example.com>|
|Date:||1 Dec 2000 13:36:19 -0500|
|Keywords:||yacc, storage, comment|
|Posted-Date:||01 Dec 2000 13:36:19 EST|
> This introduces a problem, however, because those semantic values
> popped off the stack, can contain pointers to subtrees... Therefore,
> I have memory leaks and I would like to deallocate those subtrees.
I'd suggest using stack-based memory allocator - alloca(). Once you
leave the current stack level, all the memory would be "deallocated"
BTW this mechanism is used for maintaining bison own stack-memory.
[So long as you're willing to stick with C compilers that have alloca(),
it's not a bad solution. -John]
Return to the
Search the comp.compilers archives again.