PDA

View Full Version : [C++]how to set GLIBCXX_FORCE_NEW?



SledgeHammer_999
November 25th, 2008, 03:44 PM
I have a C++ program where I use many functions of std::string and std::vector. I am using valgrind and I am getting some "leaks" related to these functions. But as I read here-->http://valgrind.org/docs/manual/faq.html#faq.reports
I need to set the GLIBCXX_FORCE_NEW env variable to immediately free the memory from the pool.
Can you give me an example on how to do this? I don't have clue...

Trail
November 25th, 2008, 03:46 PM
Edit: type "export GLIBCXX_FORCE_NEW" in the same terminal where you are running your program.

SledgeHammer_999
November 25th, 2008, 07:34 PM
thank you