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

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...

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

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