|flex memory leaks firstname.lastname@example.org (2000-03-11)
|11 Mar 2000 13:38:48 -0500
|Deja.com - Before you buy.
|lex, question, comment
I'M New To Flex/Bison, And In Order To Learn The Basics, I Decided To
Write A .Ini File Parser. Seems To Be Working Fine, Except That In The
Flex-Generated Scanning Code, I Get Memory Leaks - One Of About 16k And
One Of About 40 Bytes. They're Both Happening In yy_create_buffer. How
Do I Get Flex To Free Up This Memory? I Read In A Dusty Faq Somewhere
That Flex Is Good About Cleaning Up After Itself, So I'M Sure I'M Doing
Something Wrong... Or Not Doing Something Altogether... But It Kind Of
Eludes Me. I See That Calling yy_delete_buffer On yy_current_buffer
Might Be Helpful, But I Don't Want To Hack, I Want To Learn How To Do
It The Right Way... Thanks In Advance!
[Look at the generated lexer -- yy_create_buffer allocates a small control
structure and a large data buffer, just as you're seeing. Deleting it
with yy_delete_buffer is indeed the way to free the space. -John]
Return to the
Search the comp.compilers archives again.