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.

Telegram announces Search Filters

With the help of the Search Filters option, users can now filter search results by type. They can do that by using the new tabs: Media, Links, Files and others. Searches can be done based on the particular time period like by typing in the date or even “Yesterday”. If users type in the name of a person, group, channel or bot, an extra filter will be applied to the searches.

telegram from br


Telegram C++ geek
FROM USA