(flex.info)Memory leak - 16386 bytes allocated by malloc.


Next: How do I track the byte offset for lseek()? Prev: Why doesn't flex have non-greedy operators like perl does? Up: FAQ
Enter node , (file) or (file)node

Memory leak - 16386 bytes allocated by malloc.
==============================================

UPDATED 2002-07-10: As of 'flex' version 2.5.9, this leak means that you
did not call 'yylex_destroy()'.  If you are using an earlier version of
'flex', then read on.

   The leak is about 16426 bytes.  That is, (8192 * 2 + 2) for the
read-buffer, and about 40 for 'struct yy_buffer_state' (depending upon
alignment).  The leak is in the non-reentrant C scanner only (NOT in the
reentrant scanner, NOT in the C++ scanner).  Since 'flex' doesn't know
when you are done, the buffer is never freed.

   However, the leak won't multiply since the buffer is reused no matter
how many times you call 'yylex()'.

   If you want to reclaim the memory when you are completely done
scanning, then you might try this:

     /* For non-reentrant C scanner only. */
     yy_delete_buffer(YY_CURRENT_BUFFER);
     yy_init = 1;

   Note: 'yy_init' is an "internal variable", and hasn't been tested in
this situation.  It is possible that some other globals may need
resetting as well.


automatically generated by info2www version 1.2.2.9