The Valgrind Project releases version 3.4.0
The Valgrind Project releases version 3.4.0
Posted Jan 15, 2009 3:09 UTC (Thu) by pr1268 (guest, #24648)Parent article: The Valgrind Project releases version 3.4.0
Cool! I like Valgrind—it's certainly useful for hunting down memory leaks. And, since I have a gnarly case of OCD, I'm always checking my own C/C++ programs for leaks. :-\
For some valgrind fun, watch how the below C++ program leaks 19 bytes (likely due to me pulling the plug just after the std::string was allocated in free store):
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void die()
{
exit(EXIT_SUCCESS);
}
int main()
{
string s("I leak");
cout << s << endl;
die();
}
Many thanks to the Valgrind developers!
