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

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

telegram from jp


Telegram C++ geek
FROM USA