Mail Archives: djgpp/1998/03/26/05:26:23
At 13:07 26.03.98 +0300, you wrote:
>
>On Thu, 26 Mar 1998, Anton Helm wrote:
>
>> 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.
>But your problem was, as I recall it, that Flex was using up 16K
>*per buffer*. yy_delete_buffer should be the solution for n-1 buffers
>out of n, at the least.
Sorry for my beeing inprecise.
I mean:
I have a program.exe that reads n different files with n
different flex/bison parsers(e.g. aalex(), bblex(), cclex(), ...)
each of them consuming at least 16k.
Any of the n files may contain any number m of (nested) "include"
statements. The buffers for these m flex inputs can be freed
with yy_delete_buffer. But not the n initial buffers.
A typical number from one of our projects is 9 parsers per *.exe
which means 144k memory waste.
>Surely, any modern machine can afford allocating
>16KB, no?
Not any bit.
I'm not writing Micros*** programs :-)
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 -