627 B
627 B
Linux compilation
> mkdir build
> cd build
> cmake -DCMAKE_BUILD_TYPE=Debug ..
> make
Valgrind usage
> valgrind valgrind_params path/to/binary binary_params, eg:
> valgrind --leak-check=full ./Resource 5
> or full output using command: valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt ./Resource
Resource exapmle
- Compile and run Resource application and check memory leaks under valgrind
- Fix memory leaks with a proper usage of delete operator
- Refactor the solution to use
std::unique_ptr<> - Use
std::make_unique