Date: Tue, 24 Mar 1998 21:54:28 -0800 (PST) Message-Id: <199803250554.VAA20210@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Olivier Perron , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: flex never frees some buffers !? Precedence: bulk At 11:14 3/24/1998 +0100, Olivier Perron wrote: >Hi, > >I've just discovered that flex (flex254b) never frees the 2 following >buffers: > - yy_current_buffer->yy_ch_buf (size: approx. 16 kbytes) > - yy_current_buffer (size: 40 bytes) > >When the program that use flex exits, it leaves ~16 kbytes of allocated >memory which is never freed. >On unix it is not a problem because when a process die any unfreed memory >that was allocated by the process will be freed by the kernel. >But on DOS machines, this unfreed memory still remain as allocated and is >definitivly lost until next reboot. That's not true. On DOS also, memory unfreed at termination does get freed. What made you think otherwise? >So if you want to recover those 2 buffer, you have to add a "clean-up" >procedure on program's exit in order to free them. If the memory leak worries you, you can; otherwise ignore it. >Is it a known problem/bug or did I miss something ? I suspect there is a reason for not freeing these (perhaps flex expects to have to use them later?? I haven't investigated), but if you think otherwise, feel free to report it as a bug to GNU. Nate Eldredge eldredge AT ap DOT net