tool recommendations: C heap leak checker that works with C++ code
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
perhaps you may consider writing your own equivalent of stl::unique_ptr etc.
-
perhaps you may consider writing your own equivalent of stl::unique_ptr etc.
I've considered it, but I should also need to use the emplace new operator and I'm currently not doing that, so I'm not using RAII. I could, but it would require retooling quite a bit of code. Another related reason I'm not using RAII is this evolved from a reference implementation in C.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
i wrote such a tool many years ago . it was simple crude but effective . as best i recall it merely placed an intermediary / agent in front of malloc / free so kept records . at program exit of course its vector should be empty . it also read and stored from the stack the malloc call site so as to permit identifying the responsible party .
-
i wrote such a tool many years ago . it was simple crude but effective . as best i recall it merely placed an intermediary / agent in front of malloc / free so kept records . at program exit of course its vector should be empty . it also read and stored from the stack the malloc call site so as to permit identifying the responsible party .
See that's what I was looking for. I used to use a 3rd party tool for it, because I am paranoid about bugs in my debug code, you know? I just can't remember what it was, since it has been too long.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
See that's what I was looking for. I used to use a 3rd party tool for it, because I am paranoid about bugs in my debug code, you know? I just can't remember what it was, since it has been too long.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Oooh thank you! I'll give that a shot. Update: Works fantastically. Thanks again!
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
For Linux: AddressSanitizerLeakSanitizer[^] Also see: AddressSanitizer — Clang 18.0.0git documentation[^] Something similar exists for Visual Studio, see CodeProject article: Address Sanitizer in Visual C++[^] For a comparison between AddressSanitizer and Other Memory Detect Tools, see: Medium article[^] :-\
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Try [DrMemory](https://drmemory.org/).
-
Try [DrMemory](https://drmemory.org/).
Thanks. Unlike Deleaker it's free, but looks a little bit cumbersome to use relatively (not saying it's awkward, it's just that deleaker is very slick workflow-wise) I'll give them a comparison run.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
If you can run the code in windows and compile with Visual Studio then you can use its built-in facility along with this header file : Memory Allocation Tracking for C++ Code[^].
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
-
If you can run the code in windows and compile with Visual Studio then you can use its built-in facility along with this header file : Memory Allocation Tracking for C++ Code[^].
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
Yeah, that's an option, although less than ideal as my code isn't currently tied to a particular compiler. That said I could probably keep the blast radius of the changes small enough to manage. However, I've been pointed to Deleaker which worked aces and didn't require me to instrument my code.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Back when I still did C++ stuff I used BoundsChecker, not sure if it's still around... was that the one you didn't remember?
Luca The Price of Freedom is Eternal Vigilance. -- Wing Commander IV En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur. (But the best thing God has created, is a New Day.) -- Sigur Ròs - Viðrar vel til loftárása
-
Back when I still did C++ stuff I used BoundsChecker, not sure if it's still around... was that the one you didn't remember?
Luca The Price of Freedom is Eternal Vigilance. -- Wing Commander IV En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur. (But the best thing God has created, is a New Day.) -- Sigur Ròs - Viðrar vel til loftárása
You know what? That sounds familiar, so it's likely. I'll look into it, thanks!
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
[Application Verifier](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/application-verifier)
-
I have to use STL-less C++ w/ malloc instead of new because embedded devices often have multiple heaps. I've built out a set of complicated classes that do a lot of little allocations and I need a tool to check and make sure I'm not leaking. I haven't used one of these in so many years I can't even remember the names of the tools I used to use. Any recommends?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Many centuries ago, had used VTune. It's still around. https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html
-
Many centuries ago, had used VTune. It's still around. https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html
My experience with Intel tools is they have been clunky at best and confusing at worst, so I tend to avoid them if I have other solutions. In this case I do. So thank you, but no offense, I'll pass on VTune.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
My experience with Intel tools is they have been clunky at best and confusing at worst, so I tend to avoid them if I have other solutions. In this case I do. So thank you, but no offense, I'll pass on VTune.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
:thumbsup:
-
Back when I still did C++ stuff I used BoundsChecker, not sure if it's still around... was that the one you didn't remember?
Luca The Price of Freedom is Eternal Vigilance. -- Wing Commander IV En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur. (But the best thing God has created, is a New Day.) -- Sigur Ròs - Viðrar vel til loftárása