|
Wordle 856 4/6
⬛⬛⬛⬛🟨
⬛🟨🟨⬛⬛
🟨🟨🟨🟨⬛
🟩🟩🟩🟩🟩
|
|
|
|
|
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.
|
|
|
|
|
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 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
|
|
|
|
|
I use Deleaker[^] to find leaks in Visual Studio.
|
|
|
|
|
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
modified 22-Oct-23 5:22am.
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
Luca Leonardo Scorcia wrote: I used BoundsChecker
Yes I remember that too.
I think that was one of the very few tools I bought back then. Probably along with the Borland IDE.
But far as I can tell you can't get just that (by itself) anymore.
|
|
|
|
|
|
|
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
|
|
|
|
|
|
you can avoid red lights by driving at 114,004,827 mph at that speed they will be blue shifted enough to appear green .
|
|
|
|
|
How long will it take my 4-cyl Camry to reach that speed?
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
About a week if you find a steep enough hill. Tyre damage may occur at those speeds however - you might want to check the pressures really carefully before trying.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Which would go first? The tyres or the bearings? Probably the first, but the second will follow long before that speed is reached by any physical components!
|
|
|
|
|
I'd also be wary of the brakes - the stopping distance from those speeds is going to about 122,943,292,246 miles (or 1322 AU if you prefer) according to the Highway Code. Although modern brakes are much more efficient than those HC was based on, some significant brake fade is to be expected.
If a child runs out unexpectedly in front of you from behind Pluto, I suspect you are going to kill him / her.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|