trainings/AdvancedCppV2/Presentation/exercises/resource
2024-04-26 15:46:09 +02:00
..
solution AdvC++ - pierwszy commit 2024-04-25 09:39:28 +02:00
CMakeLists.txt AdvC++ - różnica międfzy starą alokacją a smart pointerami 2024-04-26 15:46:09 +02:00
README.md AdvC++ - pierwszy commit 2024-04-25 09:39:28 +02:00
resource.cpp AdvC++ - różnica międfzy starą alokacją a smart pointerami 2024-04-26 15:46:09 +02:00
resource2.cpp AdvC++ - różnica międfzy starą alokacją a smart pointerami 2024-04-26 15:46:09 +02:00

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

  1. Compile and run Resource application and check memory leaks under valgrind
  2. Fix memory leaks with a proper usage of delete operator
  3. Refactor the solution to use std::unique_ptr<>
  4. Use std::make_unique