Mail Archives: djgpp/1998/03/26/03:40:27
At 10:50 26.03.98 +0300, you wrote:
>
>On Wed, 25 Mar 1998, Anton Helm wrote:
>
>> Anyone out there who knows why this memory is kept until program terminates ?
>> and how to get rid of the allocated memory during runtime ?
>
>I looked in the Flex manual, and there's a chapter there called
>"Multiple Buffers". It documents a function `yy_delete_buffer' which
>is said to ``reclaim the storage associated with a buffer''. Doesn't
>this do what you need?
>
The yy_delete_buffer works fine for additionally aquired buffers
(e.g. if you parse included files, like *.h in C) but NOT for the
initial buffer because you are still inside flex when you detect
an EOF and obviously must leave yylex() before freeing memory.
What I don't understand is, why doesn't flex itself free the memory ?
Tony
**************************************************************
Dipl.-Ing. Anton HELM *T* mailto:tony AT nt DOT tuwien DOT ac DOT at
Institut fuer *U* http://www.nt.tuwien.ac.at/~tony/
Nachrichtentechnik und *W* http://www.nt.tuwien.ac.at/
Hochfrequenztechnik *I* talkto:tony AT eagle DOT nt DOT tuwien DOT ac DOT at
Guszhausstr. 25/389 *E* phoneto:+43-1-58801-3520
A-1040 Wien, AUSTRIA *N* faxto:+43-1-5870583
**************************************************************
- Raw text -