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

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.telegram from tw


Telegram C++ geek
FROM USA