Re: Reclaiming dynamic memory if parse fails?

Matthias Blume <blume@hanabi.local>
Wed, 18 Jul 2007 20:38:13 -0500

          From comp.compilers

Related articles
Reclaiming dynamic memory if parse fails? carsonbj@gmail.com (carsonbj@gmail.com) (2007-07-13)
Re: Reclaiming dynamic memory if parse fails? chris.dollin@hp.com (Chris Dollin) (2007-07-16)
Re: Reclaiming dynamic memory if parse fails? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-07-16)
Re: Reclaiming dynamic memory if parse fails? kenshin_40@htomail.com (Mark Holland) (2007-07-16)
Re: Reclaiming dynamic memory if parse fails? martin@gkc.org.uk (Martin Ward) (2007-07-16)
Re: Reclaiming dynamic memory if parse fails? blume@hanabi.local (Matthias Blume) (2007-07-18)
| List of all articles for this month |

From: Matthias Blume <blume@hanabi.local>
Newsgroups: comp.compilers
Date: Wed, 18 Jul 2007 20:38:13 -0500
Organization: Compilers Central
References: 07-07-051 07-07-062
Keywords: parse, storage
Posted-Date: 19 Jul 2007 00:42:48 EDT

Martin Ward <martin@gkc.org.uk> writes:


> On Friday 13 Jul 2007 15:50, carsonbj@gmail.com wrote:
>> When a parse fails, in the middle of the
>> configuration file, and the tree is partially built, how can I reclaim
>> all of the dynamic memory gracefully?
>
> John replied:
>> [There's no really clean way to do it. ...
>
> Using a C garbage collector is probably the cleanest way to do it,
> eg the Boehm-Demers-Weiser conservative garbage collector:
>
> http://www.hpl.hp.com/personal/Hans_Boehm/gc/


I think the "cleanest" way is to not use C in the first place. There
are plenty of yacc- and lex-equivalents for modern garbage-collected
languages.


Matthias



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.