Mail Archives: djgpp/1999/09/08/14:24:53
At 02:23 PM 9/7/99 +0200, you wrote:
>
>On Tue, 7 Sep 1999, Jongwhan Lee wrote:
>
>> Detected memory leaks!
>> Dumping objects ->
>> {45} normal block at 0x00346E38, 16386 bytes long.
>> Data: < rtex { 1 1 2> 00 00 72 74 65 78 20 7B 0A 09 31 20 31 20 20 32
>> {44} normal block at 0x00431F70, 40 bytes long.
>> Data: < h% 8n4 8n4 @ > 08 68 25 10 38 6E 34 00 38 6E 34 00 00 40 00 00
>> Object dump complete.
>> The thread 0x199 has exited with code 0 (0x0).
>
>I don't understand these messages. How does VC decide that these are
>leaks? A buffer that isn't freed when the program exits isn't
>necessarily a leak: it might have been used all the time before exit.
These are well known memory leeks in flex generated lexers.
One of them is the input buffer (I've forgotten what the other was
Altzheimer, you know ...)
As far as I understand it you need these buffers for special purposes
(e.g. restart the lexer).
If you don't use such features you might free these two memory blocks
_AFTER_ (!!!) using the lexer. E.g. when you have fclosed() the input file.
DON'T FREE THIS MEMORY WITH END-OF-FILE RULES !!!
(You will get a crash)
Tony
- Raw text -