Skip to main content
gamedev.net
🔒 Locked

Leaky Flex

Started by OBP 0 replies 200+ views
Original Post
OBP
OBP
Hey, anybody ever had problems with Flex (or Bison) leaking memory? I''m having major problems with them. I''m working on a sharewate solitaire game, with an interpreted scripting language for creating custom games. I''m using the newest versions of Flex and Bison for the lexer and parser. When I compile a script however, I get a LOT of leaked memory. There is no damage, and they are ''untraceable'' leaks - ie. Leaks created using other memory operations beside the debug version of new (malloc, alloca, etc.). VC doesn''t show the source (because the''re not created using new), and there''s no question that it''s not in my code. I had a problem like this before, where flex wasn''t freeing it''s global buffer. I fixed it by adding a call to yy_delete with the current buffer as a parameter at the end-of-file handler in the lexer code itself, however I am at a loss about these leaks. They generally contain tokens or pieces of tokens from the script code, and I have searched everywhere, but I can''t seem to find any answers.
Void
Void
The leak might be from VC itself. Have you run it thru a leak checker to verify? But I''m won''t be surprised if flex(or bison) is leaking memory.

Try this
www.softwareverfiy.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.