Fix Memory Leaks in C Code with Valgrind
HTML-код
- Опубликовано: 3 июл 2022
- In this video, we learn how to discover and fix memory leaks in C, using Valgrind.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/ Наука
Valgrind becomes especially powerful when you're compiling with debug symbols (-g), since it then also shows you the file and line number where the leak, invalid write etc. occurs (as can be seen for some STL functions in the video).
I do believe your channel is outstanding with remarkable and consistent content . You are brilliant person who share the knowledge and inspire people to be better in probably most challenging domain in our times. I love especially parts where you discuss great Linux, C++ , compilers, and other content connected with fundamental principles of Computer Science. Keep finger for you success and goals!
please more c content!
love ur videos
Thanks for the video ... It helps allot
So useful to find memory leaks when you make glue code between python and C
"[numOfAllocs] allocations, [numOfFrees] frees"; The program gives you a summary of the number of memory allocations and deallocations by providing an overall count, possibly before providing you with more information on each specific memory leak. This is just in case you have dozens of memory leaks to fix and you need to run it multiple times in order to make sure each one is taken care of.
this is a great insight into interpreting the checks. but i will like you to explain to deal with the errors that occur as a result of the invalid write of size 4..... thanks
Hey, I watch lots of your videos, and I see you are a beast with python and other languages, and I since im working on this project, I decided to ask you this. Can you show how to make a steam account generator please? I'm trying to do it in python using selenium and the online temp-mail generator but it's a bit hard to set up proxies,solve the captchas and I don't really know how to confirm the email. Thank you!!
👍Thanks!
Thx_.
shouldnt it be malloc(sizeof(char)*20))?
sizeof(char) is equal to 1, i would still do it for clarity though
Hello!
--track-origins doesn't help with leak detection
As valgrind --help says
--track-origins=no|yes show origins of undefined values? [no]
You can also track file descriptors
--track-fds=no|yes|all track open file descriptors? [no]
(which will be the int file descriptor underlying the FILE interface)
I liked the video and this was helpful. One thing though is that sometimes when you talk you sound like you're bored like at 6:10. Sometimes my teachers speak like that and for some reason, it irritates me. Even TWT sometimes speaks like that and I'm not sure why it's so common :D. Just a small point, but I still really like your videos in general.
Because we are all dead inside.. haha
where did u even get valgrind? do u need to install it? Is it an extention?
Watch the video again. It says right there.
Hi from Crimea? Russia. Am see your video with Yandex/Alisa AI/ Translate ;)