Telegram Group & Telegram Channel
🔧 Как ловить утечки памяти в C++ за 5 минут
Инструмент — valgrind.

Когда пишем на C++, особенно без smart pointers, утечки памяти — обычное дело. Часто их даже не видно. А valgrind — это наш рентген.

👣 Быстрый гайд:

1. Установи valgrind:

sudo apt install valgrind


2. Собери проект с отладочной информацией:

g++ -g main.cpp -o app


3. Запусти под valgrind:

valgrind ./app


4. И читай отчёт:

==12345== 10 bytes in 1 blocks are definitely lost in loss record 1 of 1


💡 Фишка:
Добавь --leak-check=full и --track-origins=yes — получишь больше деталей, где именно утечка:


valgrind --leak-check=full --track-origins=yes ./app


➡️ @cpp_geek



tg-me.com/cpp_geek/298
Create:
Last Update:

🔧 Как ловить утечки памяти в C++ за 5 минут
Инструмент — valgrind.

Когда пишем на C++, особенно без smart pointers, утечки памяти — обычное дело. Часто их даже не видно. А valgrind — это наш рентген.

👣 Быстрый гайд:

1. Установи valgrind:


sudo apt install valgrind


2. Собери проект с отладочной информацией:

g++ -g main.cpp -o app


3. Запусти под valgrind:

valgrind ./app


4. И читай отчёт:

==12345== 10 bytes in 1 blocks are definitely lost in loss record 1 of 1


💡 Фишка:
Добавь --leak-check=full и --track-origins=yes — получишь больше деталей, где именно утечка:


valgrind --leak-check=full --track-origins=yes ./app


➡️ @cpp_geek

BY C++ geek


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/cpp_geek/298

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new app—funded with the proceeds from the VK sale—less as a business than as a way for people to send messages while avoiding government surveillance and censorship.

However, analysts are positive on the stock now. “We have seen a huge downside movement in the stock due to the central electricity regulatory commission’s (CERC) order that seems to be negative from 2014-15 onwards but we cannot take a linear negative view on the stock and further downside movement on the stock is unlikely. Currently stock is underpriced. Investors can bet on it for a longer horizon," said Vivek Gupta, director research at CapitalVia Global Research.

telegram from ms


Telegram C++ geek
FROM USA